aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorEwan Mellor <ewan@xensource.com>2007-04-05 13:35:54 +0100
committerEwan Mellor <ewan@xensource.com>2007-04-05 13:35:54 +0100
commit8f38cefadc71d700ae3b712b60495f668b72f65f (patch)
treee3d38c7ba0843a2426dfebf8c926bfb8471542fc /tools
parent880b3023d489f864d109f3de4857002bc7bf29df (diff)
downloadxen-8f38cefadc71d700ae3b712b60495f668b72f65f.tar.gz
xen-8f38cefadc71d700ae3b712b60495f668b72f65f.tar.bz2
xen-8f38cefadc71d700ae3b712b60495f668b72f65f.zip
Remove task.error_code -- it's redundant, as we can use the first element of
task.error_info instead. Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/python/xen/xend/XendAPI.py5
-rw-r--r--tools/python/xen/xend/XendTask.py10
2 files changed, 3 insertions, 12 deletions
diff --git a/tools/python/xen/xend/XendAPI.py b/tools/python/xen/xend/XendAPI.py
index 78128f35b4..b31a00899b 100644
--- a/tools/python/xen/xend/XendAPI.py
+++ b/tools/python/xen/xend/XendAPI.py
@@ -789,7 +789,6 @@ class XendAPI(object):
'progress',
'type',
'result',
- 'error_code',
'error_info',
'allowed_operations',
'session'
@@ -824,10 +823,6 @@ class XendAPI(object):
task = XendTaskManager.get_task(task_ref)
return xen_api_success(task.result)
- def task_get_error_code(self, session, task_ref):
- task = XendTaskManager.get_task(task_ref)
- return xen_api_success(task.error_code)
-
def task_get_error_info(self, session, task_ref):
task = XendTaskManager.get_task(task_ref)
return xen_api_success(task.error_info)
diff --git a/tools/python/xen/xend/XendTask.py b/tools/python/xen/xend/XendTask.py
index 0485c39207..5045a06d75 100644
--- a/tools/python/xen/xend/XendTask.py
+++ b/tools/python/xen/xend/XendTask.py
@@ -24,7 +24,7 @@ class XendTask(threading.Thread):
"""Represents a Asynchronous Task used by Xen API.
Basically proxies the callable object in a thread and returns the
- results via self.{type,result,error_code,error_info}.
+ results via self.{type,result,error_info}.
@cvar task_progress: Thread local storage for progress tracking.
It is a dict indexed by thread_id. Note that the
@@ -71,7 +71,6 @@ class XendTask(threading.Thread):
self.uuid = uuid
self.result = None
- self.error_code = ''
self.error_info = []
self.name_label = label or func.__name__
@@ -118,13 +117,11 @@ class XendTask(threading.Thread):
self.result = result['Value']
self.set_status(XEN_API_TASK_STATUS_TYPE[1])
else:
- self.error_code = result['ErrorDescription'][0]
- self.error_info = result['ErrorDescription'][1:]
+ self.error_info = result['ErrorDescription']
self.set_status(XEN_API_TASK_STATUS_TYPE[2])
except Exception, e:
log.exception('Error running Async Task')
- self.error_code = 'INTERNAL ERROR'
- self.error_info = [str(e)]
+ self.error_info = ['INTERNAL ERROR', str(e)]
self.set_status(XEN_API_TASK_STATUS_TYPE[2])
self.task_progress_lock.acquire()
@@ -144,7 +141,6 @@ class XendTask(threading.Thread):
'progress': self.get_progress(),
'type': self.type,
'result': self.result,
- 'error_code': self.error_code,
'error_info': self.error_info,
'allowed_operations': {},
'session': self.session,