mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-12 20:38:23 +00:00
Change rename command to a name property setter for all Dynamips
devices. Adjust the tests and upload the new dynamips that supports the rename command for VMs.
This commit is contained in:
@ -49,6 +49,20 @@ class Bridge(object):
|
||||
|
||||
return self._name[1:-1] # remove quotes
|
||||
|
||||
@name.setter
|
||||
def name(self, new_name):
|
||||
"""
|
||||
Renames this bridge.
|
||||
|
||||
:param new_name: New name for this bridge
|
||||
"""
|
||||
|
||||
new_name = '"' + new_name + '"' # put the new name into quotes to protect spaces
|
||||
self._hypervisor.send("nio_bridge rename {name} {new_name}".format(name=self._name,
|
||||
new_name=new_name))
|
||||
|
||||
self._name = new_name
|
||||
|
||||
@property
|
||||
def hypervisor(self):
|
||||
"""
|
||||
@ -78,19 +92,6 @@ class Bridge(object):
|
||||
|
||||
return self._nios
|
||||
|
||||
def rename(self, new_name):
|
||||
"""
|
||||
Renames this bridge.
|
||||
|
||||
:param new_name: New name for this bridge
|
||||
"""
|
||||
|
||||
new_name = '"' + new_name + '"' # put the new name into quotes to protect spaces
|
||||
self._hypervisor.send("nio_bridge rename {name} {new_name}".format(name=self._name,
|
||||
new_name=new_name))
|
||||
|
||||
self._name = new_name
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
Deletes this bridge.
|
||||
|
Reference in New Issue
Block a user