Do not erase the IOU config

This commit is contained in:
Julien Duponchelle committed 2015-04-27 18:22:54 +02:00
1 parent d5ae4750e9
commit 324a4f73d0
3 files changed
+26 -2

No files matched your search

+2
View File
@@ -58,6 +58,8 @@ class IOUHandler:
for name, value in request.json.items():
if hasattr(vm, name) and getattr(vm, name) != value:
if name == "initial_config_content" and (vm.initial_config_content and len(vm.initial_config_content) > 0):
continue
setattr(vm, name, value)
response.set_status(201)
response.json(vm)
+1 -1
View File
@@ -973,7 +973,7 @@ class IOUVM(BaseVM):
if len(initial_config) == 0 and os.path.exists(initial_config_path):
return
with open(initial_config_path, "w+", encoding="utf-8") as f:
with open(initial_config_path, 'w+', encoding='utf-8') as f:
if len(initial_config) == 0:
f.write('')
else: