Fix examples to work with new API (and vice-versa.)

This commit is contained in:
Bob Lantz
2012-03-09 16:06:23 -08:00
parent 8e3699eca6
commit a49c85a610
10 changed files with 78 additions and 51 deletions
+4 -1
View File
@@ -95,6 +95,8 @@ class Intf( object ):
def isUp( self, set=False ):
"Return whether interface is up"
if set:
self.ifconfig( 'up' )
return "UP" in self.ifconfig()
# The reason why we configure things in this way is so
@@ -123,7 +125,7 @@ class Intf( object ):
return result
def config( self, mac=None, ip=None, ifconfig=None,
defaultRoute=None, **params):
defaultRoute=None, up=True, **params):
"""Configure Node according to (optional) parameters:
mac: MAC address
ip: IP address
@@ -136,6 +138,7 @@ class Intf( object ):
r = {}
self.setParam( r, 'setMAC', mac=mac )
self.setParam( r, 'setIP', ip=ip )
self.setParam( r, 'isUp', up=up )
self.setParam( r, 'ifconfig', ifconfig=ifconfig )
return r