test/keywords/k8s/pods/kubectl_create_pods_keywords.py
croy 82d417b9e6 New StarlingX Automation Framework
Fresh start for the StarlingX automation framework.

Change-Id: Ie265e0791024f45f71faad6315c2b91b022934d1
2024-11-29 16:01:57 -05:00

29 lines
719 B
Python

from keywords.base_keyword import BaseKeyword
from keywords.k8s.k8s_command_wrapper import export_k8s_config
class KubectlCreatePodsKeywords(BaseKeyword):
"""
Class for Kubectl Create pod keywords
"""
def __init__(self, ssh_connection):
"""
Constructor
Args:
ssh_connection:
"""
self.ssh_connection = ssh_connection
def create_from_yaml(self, yaml_file: str):
"""
Creates a pod from yaml file
Args:
yaml_file (): the yaml file
Returns:
"""
self.ssh_connection.send(export_k8s_config(f"kubectl create -f {yaml_file}"))
self.validate_success_return_code(self.ssh_connection)