X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=modules%2Fopnfv%2Futils%2Fovs_logger.py;h=eb070e3bd8398689fdb4db9569bceed2cc6d1feb;hb=9e9d853d65357f2519cd5fbadcb58105a4b0c349;hp=75b4cec80cfc045188b7c7f028157a928545fbe7;hpb=404ba6bd9aba7010566919292e3b2cb9432acb35;p=releng.git diff --git a/modules/opnfv/utils/ovs_logger.py b/modules/opnfv/utils/ovs_logger.py index 75b4cec80..eb070e3bd 100644 --- a/modules/opnfv/utils/ovs_logger.py +++ b/modules/opnfv/utils/ovs_logger.py @@ -7,7 +7,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -import opnfv.utils.OPNFVLogger as OPNFVLogger +import opnfv.utils.opnfv_logger as OPNFVLogger import os import time import shutil @@ -27,11 +27,10 @@ class OVSLogger(object): if not os.path.exists(dirpath): os.makedirs(dirpath) - def __ssh_host(self, ssh_conn, host_prefix='10.20.0'): + def __ssh_host(self, ssh_conn): try: - _, stdout, _ = ssh_conn.exec_command('hostname -I') - hosts = stdout.readline().strip().split(' ') - found_host = [h for h in hosts if h.startswith(host_prefix)][0] + _, stdout, _ = ssh_conn.exec_command('hostname') + found_host = stdout.readline() return found_host except Exception as e: logger.error(e) @@ -98,22 +97,24 @@ class OVSLogger(object): def dump_ovs_logs(self, controller_clients, compute_clients, related_error=None, timestamp=None): + """ + delete controller_clients argument because + that was producing an error in XCI installer. + + For more information see: + TODO: https://jira.opnfv.org/browse/RELENG-314 + """ + del controller_clients if timestamp is None: timestamp = time.strftime("%Y%m%d-%H%M%S") - - for controller_client in controller_clients: - self.ofctl_dump_flows(controller_client, - timestamp=timestamp) - self.vsctl_show(controller_client, - timestamp=timestamp) - - for compute_client in compute_clients: - self.ofctl_dump_flows(compute_client, - timestamp=timestamp) - self.vsctl_show(compute_client, - timestamp=timestamp) + # clients = controller_clients + compute_clients + clients = compute_clients + for client in clients: + self.ofctl_dump_flows(client, timestamp=timestamp) + self.vsctl_show(client, timestamp=timestamp) if related_error is not None: dumpdir = os.path.join(self.ovs_dir, timestamp) + self.__mkdir_p(dumpdir) with open(os.path.join(dumpdir, 'error'), 'w') as f: f.write(related_error)