Commit d79f008f by Őry Máté

common: inherit system param from parent-calls

fixes #329
parent a7e9781e
...@@ -77,6 +77,8 @@ class Operation(object): ...@@ -77,6 +77,8 @@ class Operation(object):
parent_activity = auxargs.pop('parent_activity') parent_activity = auxargs.pop('parent_activity')
if parent_activity and user is None and not skip_auth_check: if parent_activity and user is None and not skip_auth_check:
user = parent_activity.user user = parent_activity.user
if user is None: # parent was a system call
skip_auth_check = True
# check for unexpected keyword arguments # check for unexpected keyword arguments
argspec = getargspec(self._operation) argspec = getargspec(self._operation)
......
...@@ -415,7 +415,7 @@ class DestroyOperation(InstanceOperation): ...@@ -415,7 +415,7 @@ class DestroyOperation(InstanceOperation):
self.instance.destroy_net() self.instance.destroy_net()
if self.instance.node: if self.instance.node:
self.instance._delete_vm(parent_activity=activity, system=system) self.instance._delete_vm(parent_activity=activity)
# Destroy disks # Destroy disks
with activity.sub_activity( with activity.sub_activity(
...@@ -425,8 +425,7 @@ class DestroyOperation(InstanceOperation): ...@@ -425,8 +425,7 @@ class DestroyOperation(InstanceOperation):
# Delete mem. dump if exists # Delete mem. dump if exists
try: try:
self.instance._delete_mem_dump(parent_activity=activity, self.instance._delete_mem_dump(parent_activity=activity)
system=system)
except: except:
pass pass
...@@ -785,7 +784,7 @@ class SleepOperation(InstanceOperation): ...@@ -785,7 +784,7 @@ class SleepOperation(InstanceOperation):
readable_name=ugettext_noop( readable_name=ugettext_noop(
"shutdown network")): "shutdown network")):
self.instance.shutdown_net() self.instance.shutdown_net()
self.instance._suspend_vm(parent_activity=activity, system=system) self.instance._suspend_vm(parent_activity=activity)
self.instance.yield_node() self.instance.yield_node()
@register_operation @register_operation
......
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