Commit b94bda20 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))
......
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