diff options
| author | Ed Leafe <ed@leafe.com> | 2011-08-04 15:02:28 +0000 |
|---|---|---|
| committer | Ed Leafe <ed@leafe.com> | 2011-08-04 15:02:28 +0000 |
| commit | a3abff9c6243ecfddac72167320c74dce7398941 (patch) | |
| tree | 1293692d19018e240b0edc7863011ae7980703e7 | |
| parent | 9da88eac8fe728f506633f86ec6e75cf0212795b (diff) | |
Changed the definition of the 'action' dict to always occur.
| -rw-r--r-- | nova/virt/xenapi_conn.py | 7 |
1 files 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": |
