Skip to content

Commit

Permalink
fix: Minor bugs in OpenNebula driver
Browse files Browse the repository at this point in the history
  • Loading branch information
sfayer committed Oct 19, 2023
1 parent e23248c commit 76cc2cb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/DIRAC/Resources/Computing/CloudProviders/OpenNebula.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from libcloud.utils.py3 import ET
from libcloud.compute.drivers.opennebula import OpenNebulaNodeDriver, OpenNebulaNodeSize
from libcloud.compute.base import NodeDriver, NodeState
from libcloud.compute.base import NodeDriver, NodeState, Node
from libcloud.compute.base import NodeImage, NodeSize, StorageVolume
from libcloud.common.base import ConnectionUserAndKey, XmlResponse
from libcloud.common.types import LibcloudError
Expand Down Expand Up @@ -107,7 +107,7 @@ def create_node(self, name, size, image=None, network=None, context=None,
if isinstance(size, int):
tmpl_id = size
elif isinstance(size, NodeSize):
tmpl_id = size.id
tmpl_id = int(size.id)

if tmpl_id is not None:
return self._create_vm_template(name, tmpl_id, context, ex_onhold,
Expand All @@ -128,7 +128,6 @@ def _create_vm_template(self, name, tmpl_id, context, ex_onhold,

def _create_vm_direct(self, name, size, image, network, context, ex_onhold):
tmpl_str = self._gen_template(name, size, image, network, context)
print(tmpl_str)
res = self.connection.request("one.vm.allocate", tmpl_str, ex_onhold)
return self.ex_get_node(res.object)

Expand Down

0 comments on commit 76cc2cb

Please sign in to comment.