Use timeutils.isotime() in images view builder

Rather than using a direct call to strftime() with the same format
as timeutils.isotime() just use isotime() itself.

Full context here:

  http://lists.openstack.org/pipermail/openstack-dev/2014-April/033971.html

Change-Id: Ifeb9e24566e220f80cf8051ec16b8c868908c642
This commit is contained in:
Mark McLoughlin 2014-04-29 12:28:29 +01:00
parent 6d88be2049
commit 2c3d2814ca
1 changed files with 5 additions and 4 deletions

View File

@ -16,6 +16,7 @@
from nova.api.openstack import common
from nova.image import glance
from nova.openstack.common import timeutils
class ViewBuilder(common.ViewBuilder):
@ -122,10 +123,10 @@ class ViewBuilder(common.ViewBuilder):
str(identifier)])
@staticmethod
def _format_date(date_string):
"""Return standard format for given date."""
if date_string is not None:
return date_string.strftime('%Y-%m-%dT%H:%M:%SZ')
def _format_date(dt):
"""Return standard format for a given datetime object."""
if dt is not None:
return timeutils.isotime(dt)
@staticmethod
def _get_status(image):