Commit df92dc2f authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

BUGFIX: fix c931d60c

After c931d60c, default was "None" which means false.
But we want the default to be true. So use the special default argparse.SUPPRESS that removes totally the arg from arg dict.
It will let the default come from the FormatConfig class attribute.
parent 2a0975a2
......@@ -29,6 +29,7 @@
import logging
import sys
import argparse
from slapos.cli.command import check_root_user
from slapos.cli.config import ConfigCommand
......@@ -62,13 +63,13 @@ class FormatCommand(ConfigCommand):
ap.add_argument('--alter_user',
choices=['True', 'False'],
#default=FormatConfig.alter_user, #can't use default here because it would overwrite .cfg
default=argparse.SUPPRESS, #can't use default here because it would overwrite .cfg
help='Shall slapformat alter user database'
' (default: {})'.format(FormatConfig.alter_user))
ap.add_argument('--alter_network',
choices=['True', 'False'],
#default=FormatConfig.alter_network, #can't use default here because it would overwrite .cfg
default=argparse.SUPPRESS, #can't use default here because it would overwrite .cfg
help='Shall slapformat alter network configuration'
' (default: {})'.format(FormatConfig.alter_network))
......
......@@ -1380,8 +1380,8 @@ class FormatConfig(object):
cert_file = None
alter_network = 'True'
alter_user = 'True'
create_tap = True
create_tun = False
create_tap = None
create_tun = None
computer_xml = None
computer_json = None
input_definition_file = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment