diff options
author | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-05-18 15:58:22 +0200 |
---|---|---|
committer | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-05-18 15:58:22 +0200 |
commit | 28a25918b2452423e753735aed83e13168f51020 (patch) | |
tree | 46226b836928382d8e3eacd737af0f7862544be6 /src/virtual | |
parent | 2e6b73da53ae530bdd0bda22a52824bc5d9f94bf (diff) |
Update filesystems on /refresh
This updates partitions.json filesystems.
Diffstat (limited to 'src/virtual')
-rw-r--r-- | src/virtual/ogOperations.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/virtual/ogOperations.py b/src/virtual/ogOperations.py index 597ca58..9a806d1 100644 --- a/src/virtual/ogOperations.py +++ b/src/virtual/ogOperations.py @@ -273,10 +273,13 @@ class OgVirtualOperations: assert(len(devices) == 1) partitions = g.list_partitions() assert(len(partitions) == 1) + filesystems_dict = g.list_filesystems() + assert(len(filesystems_dict) == 1) g.mount(partitions[0], '/') used_disk = g.du('/') g.umount_all() total_size = g.disk_virtual_size(part['virt-drive']) / 1024 + part['used_size'] = int(100 * used_disk / total_size) part['size'] = total_size root = g.inspect_os() @@ -285,6 +288,12 @@ class OgVirtualOperations: f'{g.inspect_get_product_name(root[0])}' else: part['os'] = '' + filesystem = [fs for fs in filesystems_dict.values()][0] + part['filesystem'] = filesystem.upper() + if filesystem == 'ext4': + part['code'] = '0083' + elif filesystem == 'ntfs': + part['code'] = '0007' g.close() f.seek(0) f.write(json.dumps(data, indent=4)) |