Log the result of command in get_nic_name_by_ip

We need to know the result of the command run
in get_nic_name_by_ip to see what is getting parsed
since we are returning the empty string in some
cases which results in an error because
/var/run/udhcpc..pid does not exist in the guest.

Change-Id: Ie15ac360a7fd384583607d5bf1d8ce7a3d2c3576
Related-Bug: #1813198
This commit is contained in:
Matt Riedemann 2019-01-25 10:52:08 -05:00
parent ccdd729aaf
commit acd6ecdbd9
1 changed files with 1 additions and 0 deletions

View File

@ -98,6 +98,7 @@ class RemoteClient(remote_client.RemoteClient):
def get_nic_name_by_ip(self, address):
cmd = "ip -o addr | awk '/%s/ {print $2}'" % address
nic = self.exec_command(cmd)
LOG.debug('(get_nic_name_by_ip) Command result: %s', nic)
return nic.strip().strip(":").split('@')[0].lower()
def get_dns_servers(self):