From 9ff3121bd90133fb3b37c0e10407b5f7ade26b90 Mon Sep 17 00:00:00 2001 From: Zhongyue Luo Date: Wed, 6 Jun 2012 10:32:49 +0800 Subject: Replaces functions in utils.py with openstack/common/timeutils.py Fixes bug #1008628 1. Edit openstack-common.conf and import nova/openstack/common/timeutils.py 2. Move time related functions from utils.py to timeutils.py 3. Replace following functions in utils.py with timeutils.py - isotime - parse_isotime - strtime - parse_strtime - normalize_time - is_older_than - utcnow_ts - utcnow - set_time_override - advance_time_delta - advance_time_seconds - clear_time_override 4. Remove datetime related functions and datetime related unittests Change-Id: I9a92be286fb071b6237dd39495d88dae106e2ce0 --- bin/nova-manage | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/nova-manage b/bin/nova-manage index be1159f54..5414e4e5e 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -90,6 +90,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 quota from nova import rpc from nova.scheduler import rpcapi as scheduler_rpcapi @@ -968,7 +969,7 @@ class ServiceCommands(object): Show a list of all running services. Filter by host & service name. """ ctxt = context.get_admin_context() - now = utils.utcnow() + now = timeutils.utcnow() services = db.service_get_all(ctxt) if host: services = [s for s in services if s['host'] == host] @@ -1083,7 +1084,7 @@ class HostCommands(object): print "%-25s\t%-15s" % (_('host'), _('zone')) ctxt = context.get_admin_context() - now = utils.utcnow() + now = timeutils.utcnow() services = db.service_get_all(ctxt) if zone: services = [s for s in services if s['availability_zone'] == zone] -- cgit