Enable HTTPS and remove duplicate function
- Added system modify keywords to toggle the HTTP flag system-wide. - Removed duplicate function `get_subcloud_ssh`. Change-Id: I35a302d856a1d8a9fd4704eb64cf6566b30e0326 Signed-off-by: Abhishek jaiswal <abhishek.jaiswal@windriver.com>
This commit is contained in:
@@ -65,32 +65,6 @@ class LabConnectionKeywords(BaseKeyword):
|
|||||||
|
|
||||||
return connection
|
return connection
|
||||||
|
|
||||||
def get_subcloud_ssh(self, subcloud_name: str) -> SSHConnection:
|
|
||||||
"""
|
|
||||||
Gets the subcloud ssh
|
|
||||||
Returns: the SSH connection for the subcloud whose name is specified by 'subcloud_name'.
|
|
||||||
|
|
||||||
"""
|
|
||||||
lab_config = ConfigurationManager.get_lab_config()
|
|
||||||
subcloud_config = lab_config.get_subcloud(subcloud_name)
|
|
||||||
|
|
||||||
if not subcloud_config:
|
|
||||||
raise ValueError(f"There is no subcloud named {subcloud_name} defined in your config file.")
|
|
||||||
|
|
||||||
jump_host_config = None
|
|
||||||
if subcloud_config.is_use_jump_server():
|
|
||||||
jump_host_config = subcloud_config.get_jump_host_configuration()
|
|
||||||
|
|
||||||
connection = SSHConnectionManager.create_ssh_connection(
|
|
||||||
subcloud_config.get_floating_ip(),
|
|
||||||
subcloud_config.get_admin_credentials().get_user_name(),
|
|
||||||
subcloud_config.get_admin_credentials().get_password(),
|
|
||||||
ssh_port=subcloud_config.get_ssh_port(),
|
|
||||||
jump_host=jump_host_config,
|
|
||||||
)
|
|
||||||
|
|
||||||
return connection
|
|
||||||
|
|
||||||
def get_compute_ssh(self, compute_name: str) -> SSHConnection:
|
def get_compute_ssh(self, compute_name: str) -> SSHConnection:
|
||||||
"""
|
"""
|
||||||
Gets an SSH connection to the 'Compute' node whose name is specified by the argument 'compute_name'.
|
Gets an SSH connection to the 'Compute' node whose name is specified by the argument 'compute_name'.
|
||||||
|
|||||||
@@ -29,3 +29,18 @@ class SystemModifyKeywords(BaseKeyword):
|
|||||||
AlarmListKeywords(self.ssh_connection).wait_for_alarms_cleared([alarm_list_object])
|
AlarmListKeywords(self.ssh_connection).wait_for_alarms_cleared([alarm_list_object])
|
||||||
|
|
||||||
return system_show_output
|
return system_show_output
|
||||||
|
|
||||||
|
def system_modify_https_enabled(self, https_enabled: bool) -> SystemShowOutput:
|
||||||
|
"""
|
||||||
|
Runs system command system modify --https-enabled True
|
||||||
|
alias system modify -p True
|
||||||
|
|
||||||
|
Args:
|
||||||
|
https_enabled: boolean value to enable or disable https
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
SystemShowOutput object
|
||||||
|
"""
|
||||||
|
output = self.ssh_connection.send(source_openrc(f"system modify -p {https_enabled}"))
|
||||||
|
self.validate_success_return_code(self.ssh_connection)
|
||||||
|
return SystemShowOutput(output)
|
||||||
Reference in New Issue
Block a user