X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2Fhoneycomb%2FHcPersistence.py;h=1627375f72a6a1b22145231374be8b9e6955e9b5;hp=dae84bdf2210fd518fea42a8fd710e829ad54ea6;hb=da799981f5373b09398319df12e77e2efc75caa6;hpb=6a4018c9d8b356bc55af135d68803a08729d0ae1 diff --git a/resources/libraries/python/honeycomb/HcPersistence.py b/resources/libraries/python/honeycomb/HcPersistence.py index dae84bdf22..1627375f72 100644 --- a/resources/libraries/python/honeycomb/HcPersistence.py +++ b/resources/libraries/python/honeycomb/HcPersistence.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Cisco and/or its affiliates. +# Copyright (c) 2018 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -15,7 +15,7 @@ from robot.api import logger -from resources.libraries.python.constants import Constants as Const +from resources.libraries.python.Constants import Constants as Const from resources.libraries.python.honeycomb.HoneycombUtil import HoneycombError from resources.libraries.python.ssh import SSH from resources.libraries.python.topology import NodeType @@ -70,7 +70,7 @@ class HcPersistence(object): :type find: string :type replace: string :raises HoneycombError: If persistent configuration couldn't be - modified. + modified. """ argument = "\"s/{0}/{1}/g\"".format(find, replace) @@ -100,9 +100,7 @@ class HcPersistence(object): ssh = SSH() ssh.connect(node) for command in commands: - (_, stdout, _) = ssh.exec_command_sudo(command) - logger.info(stdout) - + (_, _, _) = ssh.exec_command_sudo(command) @staticmethod def configure_persistence(node, state): @@ -142,19 +140,3 @@ 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"))