Convert argument elements of task status to types
This commit is contained in:
parent
d3392c0282
commit
3b41beb0f3
|
@ -20,6 +20,7 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from requests_toolbelt.multipart.encoder import MultipartEncoder, MultipartEncoderMonitor
|
from requests_toolbelt.multipart.encoder import MultipartEncoder, MultipartEncoderMonitor
|
||||||
|
from ast import literal_eval
|
||||||
|
|
||||||
import pvc.cli_lib.ansiprint as ansiprint
|
import pvc.cli_lib.ansiprint as ansiprint
|
||||||
from pvc.cli_lib.common import UploadProgressBar, call_api
|
from pvc.cli_lib.common import UploadProgressBar, call_api
|
||||||
|
@ -723,10 +724,10 @@ def task_status(config, task_id=None, is_watching=False):
|
||||||
task['type'] = task_type
|
task['type'] = task_type
|
||||||
task['worker'] = task_host
|
task['worker'] = task_host
|
||||||
task['id'] = task_job.get('id')
|
task['id'] = task_job.get('id')
|
||||||
task_args = task_job.get('args')
|
task_args = literal_eval(task_job.get('args'))
|
||||||
task['vm_name'] = task_args[0]
|
task['vm_name'] = task_args[0]
|
||||||
task['vm_profile'] = task_args[1]
|
task['vm_profile'] = task_args[1]
|
||||||
task_kwargs = task_job.get('kwargs')
|
task_kwargs = literal_eval(task_job.get('kwargs'))
|
||||||
task['vm_define'] = str(bool(task_kwargs['define_vm']))
|
task['vm_define'] = str(bool(task_kwargs['define_vm']))
|
||||||
task['vm_start'] = str(bool(task_kwargs['start_vm']))
|
task['vm_start'] = str(bool(task_kwargs['start_vm']))
|
||||||
task_data.append(task)
|
task_data.append(task)
|
||||||
|
|
Loading…
Reference in New Issue