1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 11:18:11 +00:00
This commit is contained in:
grossmj 2014-04-28 10:03:03 -06:00
parent e0488bb31f
commit 0d856ae180
2 changed files with 14 additions and 9 deletions

View File

@ -393,16 +393,20 @@ class VM(object):
# a new startup-config has been pushed
if "startup_config_base64" in request:
config_filename = "{}.cfg".format(router.name)
response["startup_config"] = self.save_base64config(request["startup_config_base64"], router, config_filename)
if "startup_config" in response:
router.set_config(response["startup_config"])
# update the request with the new local startup-config path
request["startup_config"] = self.save_base64config(request["startup_config_base64"], router, config_filename)
if "startup_config" in request:
router.set_config(request["startup_config"])
response["startup_config"] = request["startup_config"]
# a new private-config has been pushed
if "private_config_base64" in request:
config_filename = "{}-private.cfg".format(router.name)
response["private_config"] = self.save_base64config(request["private_config_base64"], router, config_filename)
if "private_config" in response:
router.set_config(router.startup_config, response["private_config"])
# update the request with the new local private-config path
request["private_config"] = self.save_base64config(request["private_config_base64"], router, config_filename)
if "private_config" in request:
router.set_config(router.startup_config, request["private_config"])
response["private_config"] = request["private_config"]
except DynamipsError as e:
self.send_custom_error(str(e))

View File

@ -388,13 +388,14 @@ class IOU(IModule):
f.write(config)
except OSError as e:
raise IOUError("Could not save the configuration {}: {}".format(config_path, e))
response["startup_config"] = os.path.basename(config_path)
if "startup_config" in request:
iou_instance.startup_config = response["startup_config"]
# update the request with the new local startup-config path
request["startup_config"] = os.path.basename(config_path)
except IOUError as e:
self.send_custom_error(str(e))
return
# update the IOU settings
for name, value in request.items():
if hasattr(iou_instance, name) and getattr(iou_instance, name) != value:
try: