mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fixing the index out of bounds error in the check_if_link_up() function
This commit is contained in:
parent
d83995e23c
commit
09e05f2a06
@ -97,21 +97,20 @@ class CsAddress(CsDataBag):
|
||||
|
||||
def check_if_link_exists(self,dev):
|
||||
cmd="ip link show dev %s"%dev
|
||||
result=CsHelper.execute(cmd)
|
||||
if(len(result)!=0):
|
||||
result = CsHelper.execute(cmd)
|
||||
if(len(result) != 0):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def check_if_link_up(self,dev):
|
||||
cmd="ip link show dev %s | tr '\n' ' ' | cut -d ' ' -f 9"%dev
|
||||
result=CsHelper.execute(cmd)
|
||||
if(result[0].lower()=="up"):
|
||||
result = CsHelper.execute(cmd)
|
||||
if(result and result[0].lower() == "up"):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
def process(self):
|
||||
route = CsRoute()
|
||||
found_defaultroute = False
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user