X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=modules%2Fopnfv%2Futils%2Fovs_logger.py;h=2107bdc35bd173c48982e5e2455af0d8e62d049f;hb=70dd6da73b294c7d395354bc21aa1cd4be4bc966;hp=7777a9a16ea1baad3e2785fb78ae6f3253f8e59b;hpb=73ee35ddcae316bb14a219935a1225d4a59f08c8;p=releng.git diff --git a/modules/opnfv/utils/ovs_logger.py b/modules/opnfv/utils/ovs_logger.py index 7777a9a16..2107bdc35 100644 --- a/modules/opnfv/utils/ovs_logger.py +++ b/modules/opnfv/utils/ovs_logger.py @@ -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) @@ -71,7 +70,7 @@ class OVSLogger(object): def ofctl_dump_flows(self, ssh_conn, br='br-int', choose_table=None, timestamp=None): try: - cmd = 'ovs-ofctl -OOpenFlow13 dump-flows {0}'.format(br) + cmd = 'sudo ovs-ofctl -OOpenFlow13 dump-flows {0}'.format(br) if choose_table is not None: cmd = '{0} table={1}'.format(cmd, choose_table) output = self.__remote_cmd(ssh_conn, cmd) @@ -86,7 +85,7 @@ class OVSLogger(object): def vsctl_show(self, ssh_conn, timestamp=None): try: - cmd = 'ovs-vsctl show' + cmd = 'sudo ovs-vsctl show' output = self.__remote_cmd(ssh_conn, cmd) operation = 'vsctl_show' host = self.__ssh_host(ssh_conn) @@ -98,10 +97,18 @@ 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") - - clients = controller_clients + compute_clients + # 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)