summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorAlex Meade <alex.meade@rackspace.com>2011-07-21 16:16:34 -0400
committerAlex Meade <alex.meade@rackspace.com>2011-07-21 16:16:34 -0400
commitc1b4dd1b8e3a8043b494854bc9ddd5e6cd335ef0 (patch)
treedf2b8aeab7eb6f63b283b20c1587e6380e1b37ca /nova/api
parentf7988845281ab2fb963eaf059a6308917db79ff8 (diff)
Updated time-available to be correct format
Fixed old tests to respect this
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/views/limits.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/api/openstack/views/limits.py b/nova/api/openstack/views/limits.py
index 934b4921a..e34d47e63 100644
--- a/nova/api/openstack/views/limits.py
+++ b/nova/api/openstack/views/limits.py
@@ -15,9 +15,11 @@
# License for the specific language governing permissions and limitations
# under the License.
+import datetime
import time
from nova.api.openstack import common
+from nova import utils
class ViewBuilder(object):
@@ -113,10 +115,11 @@ class ViewBuilderV11(ViewBuilder):
return limits
def _build_rate_limit(self, rate_limit):
+ next_avail = datetime.datetime.fromtimestamp(rate_limit["resetTime"])
return {
"verb": rate_limit["verb"],
"value": rate_limit["value"],
"remaining": int(rate_limit["remaining"]),
"unit": rate_limit["unit"],
- "next-available": rate_limit["resetTime"],
+ "next-available": utils.isotime(at=next_avail),
}