Files
test/keywords/linux/keyring/keyring_keywords.py
aabhinav 65d935a2b8 pylint fix 01
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>
2025-07-15 08:11:50 -04:00

27 lines
773 B
Python

from framework.ssh.ssh_connection import SSHConnection
from keywords.base_keyword import BaseKeyword
class KeyringKeywords(BaseKeyword):
"""
Keyring Keywords class
"""
def __init__(self, ssh_connection: SSHConnection):
self.ssh_connection = ssh_connection
def get_keyring(self, service: str, identifier: str) -> str:
"""
Gets a value from the keyring.
Args:
service (str): keyring service
identifier (str): keyring identifier
Returns:
str: The value from the keyring.
"""
keyring_value = self.ssh_connection.send(f"keyring get {service} {identifier}")
self.validate_success_return_code(self.ssh_connection)
return keyring_value[0].strip()