Merge pull request #274 from Modulos/develop

Context fix
This commit is contained in:
Noe 2017-05-24 20:47:54 +02:00 committed by GitHub
commit 7a5555fe99

View file

@ -154,9 +154,6 @@ class OpenNebulaManager():
<MEMORY>{memory}</MEMORY>
<VCPU>{vcpu}</VCPU>
<CPU>{cpu}</CPU>
<CONTEXT>
<SSH_PUBLIC_KEY>{ssh}</SSH_PUBLIC_KEY>
</CONTEXT>
"""
try:
disk = template.template.disks[0]
@ -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 += """<DISK>
@ -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 += """<DISK>
@ -205,6 +200,14 @@ class OpenNebulaManager():
pending=False,
extra_template=vm_specs, )
self.oneadmin_client.call(
'vm.updateconf',
vm_id,
"""<CONTEXT>
<SSH_PUBLIC_KEY>{ssh}</SSH_PUBLIC_KEY>
</CONTEXT>
""".format(ssh=ssh_key)
)
try:
self.oneadmin_client.call(
oca.VirtualMachine.METHODS['chown'],