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
This commit is contained in:
@@ -25,7 +25,7 @@ from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova import flags
|
||||
from nova import utils
|
||||
from nova.openstack.common import timeutils
|
||||
|
||||
from nova.virt.xenapi import connection as xenapi_conn
|
||||
|
||||
@@ -90,7 +90,7 @@ def find_orphaned_instances(session, verbose=False):
|
||||
# NOTE(jk0): A zombie VM is an instance that is not active and hasn't
|
||||
# been updated in over the specified period.
|
||||
is_zombie_vm = (instance.vm_state != "active"
|
||||
and utils.is_older_than(instance.updated_at,
|
||||
and timeutils.is_older_than(instance.updated_at,
|
||||
FLAGS.zombie_instance_updated_at_window))
|
||||
|
||||
if is_active_and_deleting or is_zombie_vm:
|
||||
|
||||
Reference in New Issue
Block a user