Added code to not query sdn information when node is offline
This commit is contained in:
parent
c4a61b269b
commit
49a2f77f45
1 changed files with 10 additions and 8 deletions
|
@ -311,14 +311,16 @@ class SimpleLxcNode(PyCoreNode):
|
||||||
|
|
||||||
veth.name = ifname
|
veth.name = ifname
|
||||||
|
|
||||||
# retrieve interface information
|
if self.up:
|
||||||
result, output = self.cmdresult(["ip", "link", "show", veth.name])
|
# TODO: potentially find better way to query interface ID
|
||||||
logger.info("interface command output: %s", output)
|
# retrieve interface information
|
||||||
output = output.split("\n")
|
result, output = self.cmdresult(["ip", "link", "show", veth.name])
|
||||||
veth.flow_id = int(output[0].strip().split(":")[0]) + 1
|
logger.info("interface command output: %s", output)
|
||||||
logger.info("interface flow index: %s - %s", veth.name, veth.flow_id)
|
output = output.split("\n")
|
||||||
veth.hwaddr = output[1].strip().split()[1]
|
veth.flow_id = int(output[0].strip().split(":")[0]) + 1
|
||||||
logger.info("interface mac: %s - %s", veth.name, veth.hwaddr)
|
logger.info("interface flow index: %s - %s", veth.name, veth.flow_id)
|
||||||
|
veth.hwaddr = output[1].strip().split()[1]
|
||||||
|
logger.info("interface mac: %s - %s", veth.name, veth.hwaddr)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.addnetif(veth, ifindex)
|
self.addnetif(veth, ifindex)
|
||||||
|
|
Loading…
Add table
Reference in a new issue