Fix CLI commands.

This commit is contained in:
Bob Lantz
2012-03-11 19:44:04 -07:00
parent 14ff3ad3d0
commit 8856d284c0
5 changed files with 122 additions and 67 deletions
+10
View File
@@ -104,6 +104,14 @@ class Intf( object ):
self.ifconfig( 'up' )
return "UP" in self.ifconfig()
def rename( self, newname ):
"Rename interface"
self.ifconfig( 'down' )
result = self.cmd( 'ip link set', self.name, 'name', newname )
self.name = newname
self.ifconfig( 'up' )
return result
# The reason why we configure things in this way is so
# That the parameters can be listed and documented in
# the config method.
@@ -145,6 +153,8 @@ class Intf( object ):
self.setParam( r, 'setIP', ip=ip )
self.setParam( r, 'isUp', up=up )
self.setParam( r, 'ifconfig', ifconfig=ifconfig )
self.updateIP()
self.updateMAC()
return r
def delete( self ):