diff options
author | Zhongyue Luo <lzyeval@gmail.com> | 2012-06-06 10:32:49 +0800 |
---|---|---|
committer | Zhongyue Luo <lzyeval@gmail.com> | 2012-06-16 07:17:01 +0800 |
commit | 9ff3121bd90133fb3b37c0e10407b5f7ade26b90 (patch) | |
tree | 9c3d48c0b49f89374813c23dc49bc7ded34ed414 /tools/xenserver | |
parent | fb9abcc83935b01746aeba0db4c431fe72b921fc (diff) | |
download | nova-9ff3121bd90133fb3b37c0e10407b5f7ade26b90.tar.gz nova-9ff3121bd90133fb3b37c0e10407b5f7ade26b90.tar.xz nova-9ff3121bd90133fb3b37c0e10407b5f7ade26b90.zip |
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
Diffstat (limited to 'tools/xenserver')
-rwxr-xr-x | tools/xenserver/vm_vdi_cleaner.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/xenserver/vm_vdi_cleaner.py b/tools/xenserver/vm_vdi_cleaner.py index bccf50b25..1d33586da 100755 --- a/tools/xenserver/vm_vdi_cleaner.py +++ b/tools/xenserver/vm_vdi_cleaner.py @@ -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: |