Commit 8a293708 by Bach Dániel

vm: fix UpdateNodeOperation

parent 1d852711
...@@ -1195,7 +1195,8 @@ class DisableOperation(NodeOperation): ...@@ -1195,7 +1195,8 @@ class DisableOperation(NodeOperation):
class UpdateNodeOperation(NodeOperation): class UpdateNodeOperation(NodeOperation):
id = 'update_node' id = 'update_node'
name = _("update node") name = _("update node")
description = _("Update node.") description = _("Upgrade or install node software (vmdriver, agentdriver, "
"monitor-client) with Salt.")
required_perms = () required_perms = ()
online_required = False online_required = False
async_queue = "localhost.man.slow" async_queue = "localhost.man.slow"
...@@ -1204,13 +1205,20 @@ class UpdateNodeOperation(NodeOperation): ...@@ -1204,13 +1205,20 @@ class UpdateNodeOperation(NodeOperation):
name = self.node.host.hostname name = self.node.host.hostname
client = LocalClient() client = LocalClient()
data = client.cmd( data = client.cmd(
name, module, timeout=timeout, kwarg={'mods': params}) name, module, params, timeout=timeout)
try: try:
return data[name] data = data[name]
except KeyError: except KeyError:
raise HumanReadableException.create(ugettext_noop( raise HumanReadableException.create(ugettext_noop(
"No minions matched the target.")) "No minions matched the target."))
if not isinstance(data, dict):
raise HumanReadableException.create(ugettext_noop(
"Unhandled exception: %(msg)s"), msg=unicode(data))
return data
def _operation(self, activity): def _operation(self, activity):
with activity.sub_activity( with activity.sub_activity(
'upgrade_packages', 'upgrade_packages',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment