From 17a85e38317b9b2758eae5cd41a3782625ad5d45 Mon Sep 17 00:00:00 2001 From: modulos Date: Wed, 24 May 2017 20:45:20 +0200 Subject: [PATCH] Context fix By setting the ssh key in the context section network information were overwritten. We use updateconf now --- opennebula_api/models.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/opennebula_api/models.py b/opennebula_api/models.py index 1745fb49..0c4e521b 100644 --- a/opennebula_api/models.py +++ b/opennebula_api/models.py @@ -154,10 +154,7 @@ class OpenNebulaManager(): {memory} {vcpu} {cpu} - - {ssh} - - """ + """ try: disk = template.template.disks[0] image_id = disk.image_id @@ -165,7 +162,6 @@ class OpenNebulaManager(): vcpu=int(specs['cpu']), cpu=0.1* int(specs['cpu']), memory=1024 * int(specs['memory']), - ssh=ssh_key ) vm_specs += """ @@ -187,7 +183,6 @@ class OpenNebulaManager(): vcpu=int(specs['cpu']), cpu=0.1* int(specs['cpu']), memory=1024 * int(specs['memory']), - ssh=ssh_key ) vm_specs += """ @@ -205,6 +200,14 @@ class OpenNebulaManager(): pending=False, extra_template=vm_specs, ) + self.oneadmin_client.call( + 'vm.updateconf', + vm_id, + """ + {ssh} + + """.format(ssh=ssh_key) + ) try: self.oneadmin_client.call( oca.VirtualMachine.METHODS['chown'],