summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2011-06-02 14:23:05 -0700
committerVishvananda Ishaya <vishvananda@gmail.com>2011-06-02 14:23:05 -0700
commitb2fb1738db489206557abccb631b13991c31fd4e (patch)
treeb18296adbef3f577dcf2b073073196a772ac3787 /nova/compute
parent8b6de21b5ed4248998eef7deb57b1bc4f3863276 (diff)
make all uses of utcnow use our testable utils.utcnow
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/api.py3
-rw-r--r--nova/compute/manager.py3
-rw-r--r--nova/compute/monitor.py2
3 files changed, 3 insertions, 5 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 7122ebe67..de87ddd88 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -18,7 +18,6 @@
"""Handles all requests relating to instances (guest vms)."""
-import datetime
import eventlet
import re
import time
@@ -405,7 +404,7 @@ class API(base.Base):
instance['id'],
state_description='terminating',
state=0,
- terminated_at=datetime.datetime.utcnow())
+ terminated_at=utils.utcnow())
host = instance['host']
if host:
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 3897b3a9e..a57d6e246 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -35,7 +35,6 @@ terminating it.
"""
-import datetime
import os
import socket
import sys
@@ -159,7 +158,7 @@ class ComputeManager(manager.SchedulerDependentManager):
def _update_launched_at(self, context, instance_id, launched_at=None):
"""Update the launched_at parameter of the given instance."""
- data = {'launched_at': launched_at or datetime.datetime.utcnow()}
+ data = {'launched_at': launched_at or utils.utcnow()}
self.db.instance_update(context, instance_id, data)
def _update_image_id(self, context, instance_id, image_id):
diff --git a/nova/compute/monitor.py b/nova/compute/monitor.py
index 3bb54a382..613734bef 100644
--- a/nova/compute/monitor.py
+++ b/nova/compute/monitor.py
@@ -86,7 +86,7 @@ RRD_VALUES = {
]}
-utcnow = datetime.datetime.utcnow
+utcnow = utils.utcnow
LOG = logging.getLogger('nova.compute.monitor')