Files
test/keywords/ceph/object/ceph_status_io_output.py
ppeng e55ba3fb7d Add ceph -s keywords
- Add is_ceph_healthy()
- Add wait_for_ceph_health_status()
- Add get_ceph_osd_count()
- Add get_ceph_mon_count()
- Add unit_tests ceph_s_table_parser_test.py

Change-Id: Ibda00d122a704d8741deb15be0b53afcf2d6654d
Signed-off-by: ppeng <peng.peng@windriver.com>
2025-05-14 15:14:40 -04:00

41 lines
1.0 KiB
Python

from keywords.ceph.ceph_status_section_table_parser import CephStatusSectionTableParser
from keywords.ceph.object.ceph_status_io_object import CephIOObject
class CephIOOutput:
"""
This class parses the output of Ceph IO
Example:
io:
client: 853 B/s rd, 1 op/s rd, 0 op/s wr
"""
def __init__(self, ceph_io_output: list[str]):
"""
Constructor.
Create an internal CephIOObject.
Args:
ceph_io_output (list[str]): a list of strings representing the io output
"""
ceph_table_parser = CephStatusSectionTableParser(ceph_io_output)
output_values = ceph_table_parser.get_output_values_dict()
self.ceph_io_object = CephIOObject()
if "client" in output_values:
self.ceph_io_object.client = output_values["client"]
def get_ceph_io_object(self) -> CephIOObject:
"""
Getter for CephIOObject object.
Returns (CephIOObject):
A CephIOObject
"""
return self.ceph_io_object