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.
master v0.3.2
Jose M. Guisado 2023-10-09 12:45:07 +02:00
parent d259629445
commit 68a9d6fe8f
1 changed files with 1 additions and 12 deletions

View File

@ -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])