82d417b9e6
Fresh start for the StarlingX automation framework. Change-Id: Ie265e0791024f45f71faad6315c2b91b022934d1
25 lines
749 B
Python
25 lines
749 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 KubectlCalicoctlApplyKeywords(BaseKeyword):
|
|
"""
|
|
Class for Calicoctl apply kewords
|
|
"""
|
|
|
|
def __init__(self, ssh_connection: SSHConnection):
|
|
self.ssh_connection = ssh_connection
|
|
|
|
def calicoctl_apply_from_yaml(self, yaml_file: str):
|
|
"""
|
|
Does a calicoctl apply using the given yaml file
|
|
Args:
|
|
yaml_file (): the yaml file to appy
|
|
|
|
Returns:
|
|
|
|
"""
|
|
self.ssh_connection.send(export_k8s_config(f"kubectl calicoctl apply -f {yaml_file}"))
|
|
self.validate_success_return_code(self.ssh_connection)
|