diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-06-18 17:02:19 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-06-18 17:02:19 +0000 |
| commit | 5bfa8a70e8b11f68deb101c872eace27d7a3b1b4 (patch) | |
| tree | 9c298941f50a7b080518efc53016ec89426496a3 /nova/virt | |
| parent | 60ea96b288d9d8f29d772dce3763fda466c73040 (diff) | |
| parent | 9ff3121bd90133fb3b37c0e10407b5f7ade26b90 (diff) | |
Merge "Replaces functions in utils.py with openstack/common/timeutils.py"
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/xenapi/fake.py | 4 | ||||
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 13 |
2 files changed, 9 insertions, 8 deletions
diff --git a/nova/virt/xenapi/fake.py b/nova/virt/xenapi/fake.py index a31307d89..f3671e133 100644 --- a/nova/virt/xenapi/fake.py +++ b/nova/virt/xenapi/fake.py @@ -60,7 +60,7 @@ import pprint from nova import exception from nova import log as logging from nova.openstack.common import jsonutils -from nova import utils +from nova.openstack.common import timeutils _CLASSES = ['host', 'network', 'session', 'pool', 'SR', 'VBD', @@ -739,7 +739,7 @@ class SessionBase(object): except Failure, exc: task['error_info'] = exc.details task['status'] = 'failed' - task['finished'] = utils.utcnow() + task['finished'] = timeutils.utcnow() return task_ref def _check_session(self, params): diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 43369d476..9520ba920 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -39,6 +39,7 @@ from nova import log as logging from nova.openstack.common import cfg from nova.openstack.common import importutils from nova.openstack.common import jsonutils +from nova.openstack.common import timeutils from nova import utils from nova.virt import driver from nova.virt.xenapi import firewall @@ -1202,10 +1203,10 @@ class VMOps(object): task_refs = self._session.call_xenapi("task.get_by_name_label", task) for task_ref in task_refs: task_rec = self._session.call_xenapi("task.get_record", task_ref) - task_created = utils.parse_strtime(task_rec["created"].value, - "%Y%m%dT%H:%M:%SZ") + task_created = timeutils.parse_strtime(task_rec["created"].value, + "%Y%m%dT%H:%M:%SZ") - if utils.is_older_than(task_created, timeout): + if timeutils.is_older_than(task_created, timeout): self._session.call_xenapi("task.cancel", task_ref) def poll_rebooting_instances(self, timeout): @@ -1242,15 +1243,15 @@ class VMOps(object): last_ran = self.poll_rescue_last_ran if not last_ran: # We need a base time to start tracking. - self.poll_rescue_last_ran = utils.utcnow() + self.poll_rescue_last_ran = timeutils.utcnow() return - if not utils.is_older_than(last_ran, timeout): + if not timeutils.is_older_than(last_ran, timeout): # Do not run. Let's bail. return # Update the time tracker and proceed. - self.poll_rescue_last_ran = utils.utcnow() + self.poll_rescue_last_ran = timeutils.utcnow() rescue_vms = [] for instance in self.list_instances(): |
