Files
test/keywords/k8s/files/kubectl_file_delete_keywords.py
ppeng fc4d089ea2 Add test_dell_storage.py
- Add test_dell_storage_PowerStore_procedure()
- Add marker lab_dell_storage
- Add dell-storage test resources files
- Modify helm keywords
- Modify kubectl_file_delete keywords
- Modify kubectl_exec_in_pods keywords
- Add SystemHelmChartAttributeModifyKeywords

Change-Id: I8aea53d300631b0e855ce0209534d5f73bae29af
Signed-off-by: ppeng <peng.peng@windriver.com>
2025-10-31 12:02:59 -04:00

35 lines
900 B
Python

from framework.ssh.ssh_connection import SSHConnection
from keywords.base_keyword import BaseKeyword
from keywords.k8s.k8s_command_wrapper import export_k8s_config
class KubectlFileDeleteKeywords(BaseKeyword):
"""
Keywords for delete file resources
"""
def __init__(self, ssh_connection: SSHConnection):
"""
Constructor
Args:
ssh_connection (SSHConnection): SSH connection object.
"""
self.ssh_connection = ssh_connection
def delete_resources(self, file_path: str) -> str:
"""
Deletes the dashboard resources
Args:
file_path (str): the file path
Returns:
str: the output
"""
output = self.ssh_connection.send(export_k8s_config(f"kubectl delete -f {file_path}"))
self.validate_success_return_code(self.ssh_connection)
return output