Closed rene-oromtz closed 2 days ago
I just found where the YesNoValidator is located, seems that right here it is allowing Y or Yes as a valid answer:
class YesNoValidator(Validator):
def validate(self, document):
"""
Validate that a response is understandable as a yes/no response
"""
response = document.text
if response.lower() not in ["y", "n", "yes", "no"]:
raise ValidationError(message='Enter a valid response: y(es), n(o)', cursor_position=len(response))
However, like mentioned before, the Uninstall is only taking yes
or y
as valid
uninstallMongoDb = prompt(HTML(f'<Yellow>Uninstall MongoDb? </Yellow>'), validator=YesNoValidator()) in ["y", "yes"]
Fix incoming ...
Additional enhancements:
In terms of the second issue raised .. I think they must have been related:
Selecting these options:
Resulted in this pipeline configuration
params:
- name: mas_instance_id
value: fvtstable
- name: grafana_action
value: none
- name: cert_manager_provider
value: redhat
- name: cert_manager_action
value: none
- name: common_services_action
value: none
- name: ibm_catalogs_action
value: none
- name: mongodb_action
value: none
- name: sls_action
value: none
- name: uds_action
value: none
CLI Version
IBM Maximo Application Suite Admin CLI v10.0.2
MAS CLI Input
Expected Behaviour
MongoDB, Common-Services and UDS should have been removed along with MAS coomponents
Actual Behavior
Common-Services, UDS and IBM-Catalogs were removed from the cluster
Analysis
Two issues here:
From mas-uninstall, only options for specifying an affirmative answers is y or yes
uninstallMongoDb = prompt(HTML(f'<Yellow>Uninstall MongoDb? </Yellow>'), validator=YesNoValidator()) in ["y", "yes"]
This is why the setting were set as False:While there is warning showing the valid answers, this is not getting enforced as it takes "Yes" as a valid response. Possible enhancement is to either "lower" the response from customer or to add "Yes", "Y" as possible answers.