Set default value on partition data parsing

Otherwise, ogcp breaks when receiving an unknown disk table type,
partition type or file system.
multi-ogserver
Javier Sánchez Parra 2021-11-02 16:33:25 +01:00
parent cbeafea273
commit 7faa607131
1 changed files with 3 additions and 3 deletions

View File

@ -101,11 +101,11 @@ def get_client_setup(ip):
db_partitions = r.json()['partitions']
for partition in db_partitions:
if partition['partition'] == 0:
partition['code'] = PART_SCHEME_CODES[partition['code']]
partition['code'] = PART_SCHEME_CODES.get(partition['code'], 'MSDOS')
else:
partition['code'] = PART_TYPE_CODES[partition['code']]
partition['code'] = PART_TYPE_CODES.get(partition['code'], 'EMPTY')
partition['filesystem'] = FS_CODES[partition['filesystem']]
partition['filesystem'] = FS_CODES.get(partition['filesystem'], 'EMPTY')
return db_partitions