From d2f8ce4c476cbf69dc9fea6515ff535049192050 Mon Sep 17 00:00:00 2001 From: parth-gr Date: Wed, 21 Aug 2024 22:19:30 +0530 Subject: [PATCH] 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 --- deploy/examples/create-external-cluster-resources.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deploy/examples/create-external-cluster-resources.py b/deploy/examples/create-external-cluster-resources.py index 2bc360200..45b972d11 100644 --- a/deploy/examples/create-external-cluster-resources.py +++ b/deploy/examples/create-external-cluster-resources.py @@ -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