aboutsummaryrefslogtreecommitdiffstats
path: root/app/discover/fetchers/db/db_fetch_oteps.py
diff options
context:
space:
mode:
authorKoren Lev <korenlev@gmail.com>2017-10-10 18:08:39 +0300
committerKoren Lev <korenlev@gmail.com>2017-10-10 18:08:39 +0300
commit5c6eb170878cefa12f717a62c31f7228d440e61e (patch)
tree1ac74fe56257a68ccf5a35499ba9e458a9b436ed /app/discover/fetchers/db/db_fetch_oteps.py
parenta947ad2815cea81e126e7813d718531be414b02c (diff)
release 1.1 for euphrates
Change-Id: Iddc0e0148db7c72458b7fcdfcb7664e4aa609be0 Signed-off-by: Koren Lev <korenlev@gmail.com>
Diffstat (limited to 'app/discover/fetchers/db/db_fetch_oteps.py')
-rw-r--r--app/discover/fetchers/db/db_fetch_oteps.py12
1 files changed, 7 insertions, 5 deletions
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 number>: <interface name>: ....
+ interface = l.split(":")[1].strip()
if vconnector:
doc["vconnector"] = vconnector