From 68a9d6fe8fb69a5c089b11f98dca9b3deda22e10 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Mon, 9 Oct 2023 12:45:07 +0200 Subject: disks: remove --format parameter in setup disk Every partition will be formatted since disk setup command was rewritten into Python code in ogClient. This makes "ogcli setup disk" --format parameter unusable. As the time of this commit, for backward compatibility (with the legacy web console interface) ogServer expects the "format" field inside the partition json objects conforming the "partition_setup" array. For this reason, ogCLI still adds the "format" field into the partition objects present in the partition_setup array, but using a default value which will have no effect whatsoever. --- cli/objects/disks.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/cli/objects/disks.py b/cli/objects/disks.py index d1a9ed7..9de76c4 100644 --- a/cli/objects/disks.py +++ b/cli/objects/disks.py @@ -54,12 +54,6 @@ class OgDisk(): nargs='?', default=1, help='Disk number (defaults to 1)') - parser.add_argument('--format', - nargs='?', - const=True, - type=lambda x: x.split(','), - help='Indicates which partitions to reformat if they are already present. ' - 'Use --part alone to mean all partitions.') parser.add_argument('--part', nargs='+', action='append', @@ -124,18 +118,13 @@ class OgDisk(): 'format': '0'} payload['partition_setup'].append(part) - if parsed_args.format is True or (type(parsed_args.format) == list and part_num in parsed_args.format): - do_format = '1' - else: - do_format = '0' - if fs == 'CACHE': # Assuming flag specifying if there's cache in the setup payload['cache'] = '1' payload['cache_size'] = size part = {'partition': str(p[0]), 'code': code.upper(), 'filesystem': fs.upper(), 'size': size, - 'format': do_format} + 'format': '0'} payload['partition_setup'].append(part) last_partnum = int(parsed_args.part[-1][0][0]) -- cgit v1.2.3-18-g5258