external: remove the false bool values from config file
currently we created a new config file or user creation, Which was have the user config. We were also appending the script deafult values to the config file With that all the boolean values were appended to the config.ini file v2-port-enable = False .... But the config.ini treat all the bolean values as true, irrespective of they are set to, it is because the boolean cli flag doesnt accept the argument So now removed all the false values from the config.ini Signed-off-by: parth-gr <partharora1010@gmail.com>
This commit is contained in:
1 parent
94868a9bc7
commit
d2f8ce4c47
1 file changed
+6
-1
@@ -1568,7 +1568,12 @@ class RadosJSON:
|
||||
# python treats flag-name as flag_name internally, so converting back to flag-name,
|
||||
# so we can get those values from config file
|
||||
argValue = arg.replace("_", "-")
|
||||
if argValue != "config-file":
|
||||
# do not add the config-file flag and also not add the boolean flags which are set to False
|
||||
# because config.ini file treats boolean flags as True always
|
||||
if (
|
||||
argValue != "config-file"
|
||||
and getattr(self._arg_parser, arg) != False
|
||||
):
|
||||
argument += f"{argValue} = {str(getattr(self._arg_parser, arg))}\n"
|
||||
return argument
|
||||
|
||||
|
||||
Reference in new issue
Block a user