From 82eac70bfa79f9c55877d42b8506481e017e12f5 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 (cherry picked from commit d2f8ce4c476cbf69dc9fea6515ff535049192050) (cherry picked from commit 388975cfa4d0bd5aed0be9a18545d5153a326220) --- 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 2bc3602002e4..45b972d1114c 100644 --- a/deploy/examples/create-external-cluster-resources.py +++ b/deploy/examples/create-external-cluster-resources.py @@ -1568,7 +1568,12 @@ def getFinalUsedArgs(self): # 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