update interface IP address with pexec so that backgrounded process output from the cli cannot interfere
This commit is contained in:
+3
-1
@@ -86,7 +86,9 @@ class Intf( object ):
|
|||||||
|
|
||||||
def updateIP( self ):
|
def updateIP( self ):
|
||||||
"Return updated IP address based on ifconfig"
|
"Return updated IP address based on ifconfig"
|
||||||
ifconfig = self.ifconfig()
|
# use pexec instead of node.cmd so that we dont read
|
||||||
|
# backgrounded output from the cli.
|
||||||
|
ifconfig, _err, _exitCode = self.node.pexec( 'ifconfig %s' % self.name )
|
||||||
ips = self._ipMatchRegex.findall( ifconfig )
|
ips = self._ipMatchRegex.findall( ifconfig )
|
||||||
self.ip = ips[ 0 ] if ips else None
|
self.ip = ips[ 0 ] if ips else None
|
||||||
return self.ip
|
return self.ip
|
||||||
|
|||||||
Reference in New Issue
Block a user