From a879307064f47d0451c30ef482cdf40440e09975 Mon Sep 17 00:00:00 2001 From: Shyam Doshi Date: Wed, 3 Jun 2026 16:27:50 +0530 Subject: [PATCH 1/4] [patch] Made changes to use existing File Valitdator logic --- python/src/mas/cli/install/app.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/python/src/mas/cli/install/app.py b/python/src/mas/cli/install/app.py index 13c38e73571..076e5f4c5c0 100644 --- a/python/src/mas/cli/install/app.py +++ b/python/src/mas/cli/install/app.py @@ -46,6 +46,7 @@ JsonValidator, OptimizerInstallPlanValidator, BucketPrefixValidator, + FileExistsValidator, ) from mas.devops.ocp import ( @@ -1553,20 +1554,21 @@ def facilitiesSettings(self) -> None: facilitiesPropertiesFile = self.promptForString( "Path to FACILITIES.properties file", "mas_ws_facilities_properties_file_local", + validator=FileExistsValidator() ) - if facilitiesPropertiesFile and path.exists(facilitiesPropertiesFile): - self.setParam("mas_ws_facilities_properties_file_local", facilitiesPropertiesFile) - self.setParam("mas_ws_facilities_custom_properties", "true") - - # Prompt for custom secret name (optional, with default) - customSecretName = self.promptForString("Specify the custom secret name", "mas_ws_facilities_properties_secret_name") - # Use default if not provided - if not customSecretName or customSecretName.strip() == "": - customSecretName = "custom-facilities-properties" - self.setParam("mas_ws_facilities_properties_secret_name", customSecretName) - else: - print_formatted_text(HTML("File not found. Default FACILITIES.properties will be used.")) - self.setParam("mas_ws_facilities_custom_properties", "false") + + self.setParam("mas_ws_facilities_properties_file_local", facilitiesPropertiesFile) + self.setParam("mas_ws_facilities_custom_properties", "true") + + # Prompt for custom secret name + customSecretName = self.promptForString( + "Specify the custom secret name", + "mas_ws_facilities_properties_secret_name" + ) + # Use default if not provided + if not customSecretName or customSecretName.strip() == "": + customSecretName = "custom-facilities-properties" + self.setParam("mas_ws_facilities_properties_secret_name", customSecretName) else: self.setParam("mas_ws_facilities_custom_properties", "false") From 2c67fffe9a1fdf67fc11964541f67a880ba1b81f Mon Sep 17 00:00:00 2001 From: Shyam Doshi Date: Wed, 3 Jun 2026 16:35:12 +0530 Subject: [PATCH 2/4] [patch] Refactor the code --- python/src/mas/cli/install/app.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/python/src/mas/cli/install/app.py b/python/src/mas/cli/install/app.py index 076e5f4c5c0..612ae199694 100644 --- a/python/src/mas/cli/install/app.py +++ b/python/src/mas/cli/install/app.py @@ -1552,19 +1552,14 @@ def facilitiesSettings(self) -> None: ] ) facilitiesPropertiesFile = self.promptForString( - "Path to FACILITIES.properties file", - "mas_ws_facilities_properties_file_local", - validator=FileExistsValidator() + "Path to FACILITIES.properties file", "mas_ws_facilities_properties_file_local", validator=FileExistsValidator() ) - + self.setParam("mas_ws_facilities_properties_file_local", facilitiesPropertiesFile) self.setParam("mas_ws_facilities_custom_properties", "true") # Prompt for custom secret name - customSecretName = self.promptForString( - "Specify the custom secret name", - "mas_ws_facilities_properties_secret_name" - ) + customSecretName = self.promptForString("Specify the custom secret name", "mas_ws_facilities_properties_secret_name") # Use default if not provided if not customSecretName or customSecretName.strip() == "": customSecretName = "custom-facilities-properties" From 1f28b1ec1b6c8e4340cf1f505c12bf645f8feb2e Mon Sep 17 00:00:00 2001 From: Shyam Doshi Date: Wed, 3 Jun 2026 17:27:32 +0530 Subject: [PATCH 3/4] [patch] Removed the setParam --- python/src/mas/cli/install/app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/src/mas/cli/install/app.py b/python/src/mas/cli/install/app.py index 612ae199694..da22c84a5c8 100644 --- a/python/src/mas/cli/install/app.py +++ b/python/src/mas/cli/install/app.py @@ -1551,11 +1551,10 @@ def facilitiesSettings(self) -> None: "If you choose not to upload a custom file, the default FACILITIES.properties will be used.", ] ) - facilitiesPropertiesFile = self.promptForString( + self.promptForString( "Path to FACILITIES.properties file", "mas_ws_facilities_properties_file_local", validator=FileExistsValidator() ) - self.setParam("mas_ws_facilities_properties_file_local", facilitiesPropertiesFile) self.setParam("mas_ws_facilities_custom_properties", "true") # Prompt for custom secret name From b7edde3a36b8296427e454ca96248c4e161ddf95 Mon Sep 17 00:00:00 2001 From: Shyam Doshi Date: Wed, 3 Jun 2026 17:29:59 +0530 Subject: [PATCH 4/4] [patch] Refactor the code --- python/src/mas/cli/install/app.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/src/mas/cli/install/app.py b/python/src/mas/cli/install/app.py index da22c84a5c8..f57f3b963f6 100644 --- a/python/src/mas/cli/install/app.py +++ b/python/src/mas/cli/install/app.py @@ -1551,9 +1551,7 @@ def facilitiesSettings(self) -> None: "If you choose not to upload a custom file, the default FACILITIES.properties will be used.", ] ) - self.promptForString( - "Path to FACILITIES.properties file", "mas_ws_facilities_properties_file_local", validator=FileExistsValidator() - ) + self.promptForString("Path to FACILITIES.properties file", "mas_ws_facilities_properties_file_local", validator=FileExistsValidator()) self.setParam("mas_ws_facilities_custom_properties", "true")