From a3abff9c6243ecfddac72167320c74dce7398941 Mon Sep 17 00:00:00 2001 From: Ed Leafe Date: Thu, 4 Aug 2011 15:02:28 +0000 Subject: Changed the definition of the 'action' dict to always occur. --- nova/virt/xenapi_conn.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nova/virt/xenapi_conn.py b/nova/virt/xenapi_conn.py index 39afbd650..8ddbbd33a 100644 --- a/nova/virt/xenapi_conn.py +++ b/nova/virt/xenapi_conn.py @@ -394,11 +394,10 @@ class XenAPISession(object): try: name = self._session.xenapi.task.get_name_label(task) status = self._session.xenapi.task.get_status(task) + # Ensure action is never > 255 + action = dict(action=name[:255], error=None) if id: - action = dict( - instance_id=int(id), - action=name[0:255], # Ensure action is never > 255 - error=None) + action["instance_id"] = int(id) if status == "pending": return elif status == "success": -- cgit -- cgit