X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2Fhoneycomb%2FHcPersistence.py;fp=resources%2Flibraries%2Fpython%2Fhoneycomb%2FHcPersistence.py;h=dae84bdf2210fd518fea42a8fd710e829ad54ea6;hp=83d756f9d3e1ab051991378f13a820d6235600ba;hb=6a4018c9d8b356bc55af135d68803a08729d0ae1;hpb=65765ab9f038aed6729fd436e6af6d3ca339e0d8 diff --git a/resources/libraries/python/honeycomb/HcPersistence.py b/resources/libraries/python/honeycomb/HcPersistence.py index 83d756f9d3..dae84bdf22 100644 --- a/resources/libraries/python/honeycomb/HcPersistence.py +++ b/resources/libraries/python/honeycomb/HcPersistence.py @@ -142,3 +142,19 @@ class HcPersistence(object): if ret_code != 0: raise HoneycombError("Failed to modify configuration on " "node {0}, {1}".format(node, stderr)) + + @staticmethod + def log_persisted_configuration(node): + """Read contents of Honeycomb persistence files and print to Robot log. + + :param node: Honeycomb node. + :type node: dict + """ + + command = "cat /var/lib/honeycomb/persist/{0}/data.json" + + ssh = SSH() + ssh.connect(node) + + ssh.exec_command_sudo(command.format("config")) + ssh.exec_command_sudo(command.format("context"))