Commit e436ee08 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: Display task and task_job_id

Make 'server-show' and 'server-inspect' management command to display
the 'task' and 'task_job_id' fields of the vm.
parent d4d18ed4
......@@ -94,8 +94,8 @@ class Command(BaseCommand):
['name', 'owner_uuid',
'owner_name' if displayname else Omit,
'flavor', 'image', 'state', 'backend', 'deleted',
'action', 'backendjobid', 'backendopcode',
'backendjobstatus', 'backend_time'])
'action', 'task', 'task_job', 'backendjobid',
'backendopcode', 'backendjobstatus', 'backend_time'])
uuid = vm.userid
if displayname:
......@@ -105,6 +105,7 @@ class Command(BaseCommand):
[vm.name, uuid, dname if displayname else Omit,
vm.flavor.name, image, common.format_vm_state(vm),
str(vm.backend), str(vm.deleted), str(vm.action),
str(vm.task), str(vm.task_job_id),
str(vm.backendjobid), str(vm.backendopcode),
str(vm.backendjobstatus), str(vm.backendtime)])
......
......@@ -61,20 +61,22 @@ class Command(SynnefoCommand):
image_name = "None"
image = '%s (%s)' % (imageid, image_name)
usercache = UserCache(ASTAKOS_BASE_URL, ASTAKOS_TOKEN)
usercache = UserCache(ASTAKOS_BASE_URL, ASTAKOS_TOKEN)
kv = {
'id': server.id,
'name': server.name,
'owner_uuid': userid,
'owner_name': usercache.get_name(userid),
'created': utils.format_date(server.created),
'updated': utils.format_date(server.updated),
'image': image,
'host id': server.hostid,
'flavor': flavor,
'deleted': utils.format_bool(server.deleted),
'suspended': utils.format_bool(server.suspended),
'state': format_vm_state(server),
'id': server.id,
'name': server.name,
'owner_uuid': userid,
'owner_name': usercache.get_name(userid),
'created': utils.format_date(server.created),
'updated': utils.format_date(server.updated),
'image': image,
'host id': server.hostid,
'flavor': flavor,
'deleted': utils.format_bool(server.deleted),
'suspended': utils.format_bool(server.suspended),
'state': format_vm_state(server),
'task': server.task,
'task_job_id': server.task_job_id,
}
utils.pprint_table(self.stdout, [kv.values()], kv.keys(),
......
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 to comment