diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-03-15 22:50:43 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-03-15 22:50:43 +0000 |
| commit | bb1e383ae328517593ad4757cc168bf58d951111 (patch) | |
| tree | e6a5704ffe706df901b98eb209adcfcf201e8a61 | |
| parent | 6c3fd5ada0fb286af173ac65f20bf36049b0372f (diff) | |
| parent | 6a3e22a25c9ee3b259084df2f31c61b37f097e39 (diff) | |
| download | nova-bb1e383ae328517593ad4757cc168bf58d951111.tar.gz nova-bb1e383ae328517593ad4757cc168bf58d951111.tar.xz nova-bb1e383ae328517593ad4757cc168bf58d951111.zip | |
Merge "fix timestamps to match documented ec2 api"
| -rw-r--r-- | Authors | 1 | ||||
| -rw-r--r-- | nova/api/ec2/apirequest.py | 2 | ||||
| -rw-r--r-- | nova/tests/test_api.py | 4 |
3 files changed, 4 insertions, 3 deletions
@@ -119,6 +119,7 @@ Loganathan Parthipan <parthipan@hp.com> Lorin Hochstein <lorin@nimbisservices.com> Lvov Maxim <usrleon@gmail.com> Mandell Degerness <mdegerne@gmail.com> +Mark McClain <mark.mcclain@dreamhost.com> Mark McLoughlin <markmc@redhat.com> Mark Washenberger <mark.washenberger@rackspace.com> Maru Newby <mnewby@internap.com> diff --git a/nova/api/ec2/apirequest.py b/nova/api/ec2/apirequest.py index 82259136a..c76549562 100644 --- a/nova/api/ec2/apirequest.py +++ b/nova/api/ec2/apirequest.py @@ -44,7 +44,7 @@ def _underscore_to_xmlcase(str): def _database_to_isoformat(datetimeobj): """Return a xs:dateTime parsable string from datatime""" - return datetimeobj.strftime("%Y-%m-%dT%H:%M:%SZ") + return datetimeobj.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + 'Z' class APIRequest(object): diff --git a/nova/tests/test_api.py b/nova/tests/test_api.py index 2b46be867..473e1d5f9 100644 --- a/nova/tests/test_api.py +++ b/nova/tests/test_api.py @@ -242,14 +242,14 @@ class ApiEc2TestCase(test.TestCase): "%Y-%m-%d %H:%M:%S.%f") self.assertEqual( conv(time_to_convert), - '2011-02-21T20:14:10Z') + '2011-02-21T20:14:10.634Z') # mysqlite database representation time_to_convert = datetime.datetime.strptime( "2011-02-21 19:56:18", "%Y-%m-%d %H:%M:%S") self.assertEqual( conv(time_to_convert), - '2011-02-21T19:56:18Z') + '2011-02-21T19:56:18.000Z') def test_xmlns_version_matches_request_version(self): self.expect_http(api_version='2010-10-30') |
