
Description: - Added a missing import for SSHConnection. - Added data types to function arguments and return values. - Removed Returns section in docstring when function return type is None Change-Id: Id96217573f629d40a52459a3b45d26ae0649aa03 Signed-off-by: aabhinav <ayyapasetti.abhinav@windriver.com>
32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
from framework.ssh.ssh_connection import SSHConnection
|
|
from keywords.base_keyword import BaseKeyword
|
|
from keywords.ptp.cat.objects.cat_ptp_config_output import CATPtpConfigOutput
|
|
|
|
|
|
class CatPtpConfigKeywords(BaseKeyword):
|
|
"""Class for Cat Ptp Config Keywords"""
|
|
|
|
def __init__(self, ssh_connection: SSHConnection):
|
|
"""
|
|
Constructor for CatPtpConfigKeywords class.
|
|
|
|
Args:
|
|
ssh_connection (SSHConnection): SSH connection to the active controller.
|
|
"""
|
|
self.ssh_connection = ssh_connection
|
|
|
|
def cat_ptp_config(self, config_file: str) -> CATPtpConfigOutput:
|
|
"""
|
|
This command reads the contents of a PTP configuration file.
|
|
|
|
Args:
|
|
config_file (str): the ptp config file
|
|
|
|
Returns:
|
|
CATPtpConfigOutput: the output of the cat ptp config command
|
|
"""
|
|
output = self.ssh_connection.send(f"cat {config_file}")
|
|
self.validate_success_return_code(self.ssh_connection)
|
|
cat_ptp_config_output = CATPtpConfigOutput(output)
|
|
return cat_ptp_config_output
|