Commit f9a92907 by Dudás Ádám

storage, vm: fix activity context implementations

parent d110a9d1
......@@ -130,7 +130,7 @@ class Disk(TimeStampedModel):
'driver_type': self.format,
'driver_cache': 'default',
'target_device': self.device_type + self.dev_num,
'disk_device' : 'cdrom' if self.type == 'iso' else 'disk'
'disk_device': 'cdrom' if self.type == 'iso' else 'disk'
}
def get_disk_desc(self):
......@@ -267,10 +267,10 @@ class DiskActivity(ActivityModel):
@contextmanager
def sub_activity(self, code_suffix, task_uuid=None):
act = self.create_sub(code_suffix, task_uuid)
activitycontextimpl(act)
return activitycontextimpl(act)
@contextmanager
def disk_activity(code_suffix, instance, task_uuid=None, user=None):
act = DiskActivity.create(code_suffix, instance, task_uuid, user)
activitycontextimpl(act)
return activitycontextimpl(act)
......@@ -126,13 +126,13 @@ class NodeActivity(ActivityModel):
@contextmanager
def sub_activity(self, code_suffix, task_uuid=None):
act = self.create_sub(code_suffix, task_uuid)
activitycontextimpl(act)
return activitycontextimpl(act)
@contextmanager
def node_activity(code_suffix, node, task_uuid=None, user=None):
act = InstanceActivity.create(code_suffix, node, task_uuid, user)
activitycontextimpl(act)
return activitycontextimpl(act)
class Lease(Model):
......@@ -764,13 +764,13 @@ class InstanceActivity(ActivityModel):
@contextmanager
def sub_activity(self, code_suffix, task_uuid=None):
act = self.create_sub(code_suffix, task_uuid)
activitycontextimpl(act)
return activitycontextimpl(act)
@contextmanager
def instance_activity(code_suffix, instance, task_uuid=None, user=None):
act = InstanceActivity.create(code_suffix, instance, task_uuid, user)
activitycontextimpl(act)
return activitycontextimpl(act)
class Interface(Model):
......
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