Commit f9a92907 by Dudás Ádám

storage, vm: fix activity context implementations

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