diff options
| author | Mark Washenberger <mark.washenberger@rackspace.com> | 2011-03-18 16:06:43 -0400 |
|---|---|---|
| committer | Mark Washenberger <mark.washenberger@rackspace.com> | 2011-03-18 16:06:43 -0400 |
| commit | 2f4c1802c7e482a447d348f049ff429b3d1a640c (patch) | |
| tree | f3ee3c8443ab287d4cb14037247af8ddefe08c07 /nova/api | |
| parent | 2f1a1d293915cde6e15c85e0bb43fb21ae26f7b0 (diff) | |
fix date formatting in images controller show
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/images.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nova/api/openstack/images.py b/nova/api/openstack/images.py index 98f0dd96b..94e05823e 100644 --- a/nova/api/openstack/images.py +++ b/nova/api/openstack/images.py @@ -143,6 +143,7 @@ class Controller(wsgi.Controller): image = self._service.show(req.environ['nova.context'], image_id) _convert_image_id_to_hash(image) + self._format_image_dates(image) return dict(image=image) def delete(self, req, id): @@ -164,3 +165,8 @@ class Controller(wsgi.Controller): # Users may not modify public images, and that's all that # we support for now. raise faults.Fault(exc.HTTPNotFound()) + + def _format_image_dates(self, image): + for attr in ['created_at', 'updated_at', 'deleted_at']: + if image[attr] is not None: + image[attr] = image[attr].strftime('%Y-%m-%dT%H:%M:%SZ') |
