mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
Add task.allowed_operations field, and task.cancel message. The
task_status_type enum has gained cancelling and cancelled values. Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
e9d603068b
commit
063417a54b
3 files changed
+113
-10
No files matched your search
@@ -503,11 +503,22 @@ class XendAPI(object):
|
||||
'type',
|
||||
'result',
|
||||
'error_code',
|
||||
'error_info']
|
||||
'error_info',
|
||||
'allowed_operations',
|
||||
]
|
||||
|
||||
task_attr_rw = []
|
||||
|
||||
task_funcs = [('get_by_name_label', 'Set(task)')]
|
||||
task_funcs = [('get_by_name_label', 'Set(task)'),
|
||||
('cancel', None)]
|
||||
|
||||
def task_get_name_label(self, session, task_ref):
|
||||
task = XendTaskManager.get_task(task_ref)
|
||||
return xen_api_success(task.name_label)
|
||||
|
||||
def task_get_name_description(self, session, task_ref):
|
||||
task = XendTaskManager.get_task(task_ref)
|
||||
return xen_api_success(task.name_description)
|
||||
|
||||
def task_get_status(self, session, task_ref):
|
||||
task = XendTaskManager.get_task(task_ref)
|
||||
@@ -533,13 +544,8 @@ class XendAPI(object):
|
||||
task = XendTaskManager.get_task(task_ref)
|
||||
return xen_api_success(task.error_info)
|
||||
|
||||
def task_get_name_label(self, session, task_ref):
|
||||
task = XendTaskManager.get_task(task_ref)
|
||||
return xen_api_success(task.name_label)
|
||||
|
||||
def task_get_name_description(self, session, task_ref):
|
||||
task = XendTaskManager.get_task(task_ref)
|
||||
return xen_api_success(task.name_description)
|
||||
def task_get_allowed_operations(self, session, task_ref):
|
||||
return xen_api_success({})
|
||||
|
||||
def task_get_all(self, session):
|
||||
tasks = XendTaskManager.get_all_tasks()
|
||||
@@ -549,6 +555,9 @@ class XendAPI(object):
|
||||
task = XendTaskManager.get_task(task_ref)
|
||||
return xen_api_success(task.get_record())
|
||||
|
||||
def task_cancel(self, session, task_ref):
|
||||
return xen_api_error('OPERATION_NOT_ALLOWED')
|
||||
|
||||
def task_get_by_name_label(self, session, name):
|
||||
return xen_api_success(XendTaskManager.get_task_by_name(name))
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Xen-xm 3.0\n"
|
||||
"PO-Revision-Date: 2007-01-28 12:59+0000\n"
|
||||
"PO-Revision-Date: 2007-01-28 18:02+0000\n"
|
||||
"Last-Translator: Ewan Mellor <ewan@xensource.com>\n"
|
||||
"Language-Team: xen-devel <xen-devel@lists.xensource.com>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -65,6 +65,9 @@ msgstr "The VM handle %(1)s is invalid."
|
||||
msgid "VTPM_HANDLE_INVALID"
|
||||
msgstr "The VTPM handle %(1)s is invalid."
|
||||
|
||||
msgid "OPERATION_NOT_ALLOWED"
|
||||
msgstr "You attempted an operation that was not allowed."
|
||||
|
||||
msgid "NETWORK_ALREADY_CONNECTED"
|
||||
msgstr "The network you specified already has a PIF attached to it, and so another one may not be attached."
|
||||
|
||||
|
||||