We could have different ifconfig output formats on the remote devices,
so make the parser more flexible to handle such cases.
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
for line in lines:
res = line.find("Scope:Link")
for line in lines:
res = line.find("Scope:Link")
+ if res == -1:
+ res = line.find("<link>")
addr_mask = words[2]
addr = addr_mask.split("/")
return addr[0]
addr_mask = words[2]
addr = addr_mask.split("/")
return addr[0]
+ if words[0] == "inet6":
+ return words[1]
for word in words:
if found == 1:
return word
for word in words:
if found == 1:
return word
+ if word == "HWaddr" or word == "ether":
found = 1
raise Exception("Could not find HWaddr")
found = 1
raise Exception("Could not find HWaddr")