mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Fixes #7.
This commit is contained in:
parent
e0488bb31f
commit
0d856ae180
@ -393,16 +393,20 @@ class VM(object):
|
|||||||
# a new startup-config has been pushed
|
# a new startup-config has been pushed
|
||||||
if "startup_config_base64" in request:
|
if "startup_config_base64" in request:
|
||||||
config_filename = "{}.cfg".format(router.name)
|
config_filename = "{}.cfg".format(router.name)
|
||||||
response["startup_config"] = self.save_base64config(request["startup_config_base64"], router, config_filename)
|
# update the request with the new local startup-config path
|
||||||
if "startup_config" in response:
|
request["startup_config"] = self.save_base64config(request["startup_config_base64"], router, config_filename)
|
||||||
router.set_config(response["startup_config"])
|
if "startup_config" in request:
|
||||||
|
router.set_config(request["startup_config"])
|
||||||
|
response["startup_config"] = request["startup_config"]
|
||||||
|
|
||||||
# a new private-config has been pushed
|
# a new private-config has been pushed
|
||||||
if "private_config_base64" in request:
|
if "private_config_base64" in request:
|
||||||
config_filename = "{}-private.cfg".format(router.name)
|
config_filename = "{}-private.cfg".format(router.name)
|
||||||
response["private_config"] = self.save_base64config(request["private_config_base64"], router, config_filename)
|
# update the request with the new local private-config path
|
||||||
if "private_config" in response:
|
request["private_config"] = self.save_base64config(request["private_config_base64"], router, config_filename)
|
||||||
router.set_config(router.startup_config, response["private_config"])
|
if "private_config" in request:
|
||||||
|
router.set_config(router.startup_config, request["private_config"])
|
||||||
|
response["private_config"] = request["private_config"]
|
||||||
|
|
||||||
except DynamipsError as e:
|
except DynamipsError as e:
|
||||||
self.send_custom_error(str(e))
|
self.send_custom_error(str(e))
|
||||||
|
@ -388,13 +388,14 @@ class IOU(IModule):
|
|||||||
f.write(config)
|
f.write(config)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise IOUError("Could not save the configuration {}: {}".format(config_path, e))
|
raise IOUError("Could not save the configuration {}: {}".format(config_path, e))
|
||||||
response["startup_config"] = os.path.basename(config_path)
|
# update the request with the new local startup-config path
|
||||||
if "startup_config" in request:
|
request["startup_config"] = os.path.basename(config_path)
|
||||||
iou_instance.startup_config = response["startup_config"]
|
|
||||||
except IOUError as e:
|
except IOUError as e:
|
||||||
self.send_custom_error(str(e))
|
self.send_custom_error(str(e))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# update the IOU settings
|
||||||
for name, value in request.items():
|
for name, value in request.items():
|
||||||
if hasattr(iou_instance, name) and getattr(iou_instance, name) != value:
|
if hasattr(iou_instance, name) and getattr(iou_instance, name) != value:
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user