Skip to content

Commit

Permalink
fix: More tweaks to OpenNebula driver
Browse files Browse the repository at this point in the history
  • Loading branch information
sfayer committed Oct 19, 2023
1 parent a5efaef commit 8deac9b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/DIRAC/Resources/Computing/CloudProviders/OpenNebula.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,17 @@ def __new__(cls, *args, **kwargs):
return super(NodeDriver, cls).__new__(cls)

def create_node(self, name, size, image=None, network=None, context=None,
ex_onhold=False, ex_tmpl_network=True):
ex_onhold=False, ex_tmpl_network=True, **kwargs):
tmpl_id = None
if isinstance(size, int):
tmpl_id = size
elif isinstance(size, NodeSize):
tmpl_id = int(size.id)

# Allow use of ex_userdata in place of context
if context is None and "ex_userdata" in kwargs:
context = kwargs["ex_userdata"]

if tmpl_id is not None:
return self._create_vm_template(name, tmpl_id, context, ex_onhold,
ex_tmpl_network)
Expand Down Expand Up @@ -169,6 +173,12 @@ def ex_get_node(self, node_id):
res = self.connection.request("one.vm.info", node_id)
return self._to_node(res.object)

def ex_get_node_details(self, node_name):
for node in self.list_nodes():
if node.name == node_name:
return self.ex_get_node(node.id)
return None

def ex_node_action(self, action, node):
node_id = None
if isinstance(node, int):
Expand Down

0 comments on commit 8deac9b

Please sign in to comment.