diff options
| author | Andrew Laski <andrew.laski@rackspace.com> | 2013-02-15 15:20:23 -0500 |
|---|---|---|
| committer | Andrew Laski <andrew.laski@rackspace.com> | 2013-02-19 10:06:01 -0500 |
| commit | 479254f368ecfb78bf6913dc26230e378999436e (patch) | |
| tree | c14cb1ade51529257bc92868e8840e123c8f1ab0 /nova/api | |
| parent | 6cab9c3d1c5b31284c3da5f531ab879bd27e3496 (diff) | |
Fix key check in instance actions formatter.
The 'key in object' check doesn't work for sqlalchemy models so nothing
was getting copied over during the format. This patch switches to using
get() to retrieve a value.
Bug 1126593
Change-Id: I726c2a624928247de41a077c23fe80742cbf9044
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/instance_actions.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/nova/api/openstack/compute/contrib/instance_actions.py b/nova/api/openstack/compute/contrib/instance_actions.py index 4ab32ad4c..ecacde7bf 100644 --- a/nova/api/openstack/compute/contrib/instance_actions.py +++ b/nova/api/openstack/compute/contrib/instance_actions.py @@ -71,15 +71,13 @@ class InstanceActionsController(wsgi.Controller): def _format_action(self, action_raw): action = {} for key in ACTION_KEYS: - if key in action_raw: - action[key] = action_raw[key] + action[key] = action_raw.get(key) return action def _format_event(self, event_raw): event = {} for key in EVENT_KEYS: - if key in event_raw: - event[key] = event_raw[key] + event[key] = event_raw.get(key) return event @wsgi.serializers(xml=InstanceActionsTemplate) |
