From 5c6eb170878cefa12f717a62c31f7228d440e61e Mon Sep 17 00:00:00 2001 From: Koren Lev Date: Tue, 10 Oct 2017 18:08:39 +0300 Subject: release 1.1 for euphrates Change-Id: Iddc0e0148db7c72458b7fcdfcb7664e4aa609be0 Signed-off-by: Koren Lev --- app/discover/fetchers/db/db_fetch_oteps.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'app/discover/fetchers/db/db_fetch_oteps.py') diff --git a/app/discover/fetchers/db/db_fetch_oteps.py b/app/discover/fetchers/db/db_fetch_oteps.py index f7eb8bd..85376ed 100644 --- a/app/discover/fetchers/db/db_fetch_oteps.py +++ b/app/discover/fetchers/db/db_fetch_oteps.py @@ -63,21 +63,23 @@ class DbFetchOteps(DbAccess, CliAccess, metaclass=Singleton): return results # find matching vConnector by tunneling_ip of vEdge - # look for that IP address in ifconfig for the host + # look for that IP address in 'ip address show' output for the host def get_vconnector(self, doc, host_id, vedge): tunneling_ip = vedge["configurations"]["tunneling_ip"] - ifconfig_lines = self.run_fetch_lines("ifconfig", host_id) + output_lines = self.run_fetch_lines("ip address show", host_id) interface = None - ip_string = " " * 10 + "inet addr:" + tunneling_ip + " " + ip_string = " inet {}/".format(tunneling_ip) vconnector = None - for l in ifconfig_lines: + for l in output_lines: if l.startswith(" "): if interface and l.startswith(ip_string): vconnector = interface break else: if " " in l: - interface = l[:l.index(" ")] + # line format is like this: + # : : .... + interface = l.split(":")[1].strip() if vconnector: doc["vconnector"] = vconnector -- cgit 1.2.3-korg