Fix break in vm_vdi_cleaner after oslo changes.

Added missing imports along with adding a call to config.parser_args as needed
to allow vm_vdi_cleaner to work against current master.

Corrected spelling error in comment.

Change-Id: I4d30d0f7f9718cb29fb8c4c18e9e6fa23f3496ef
Closes-Bug: #1279942
This commit is contained in:
Philip Schwartz 2014-02-14 15:46:33 -05:00
parent 43a00e4c04
commit b506529ca2

View File

@ -27,10 +27,15 @@ possible_topdir = os.getcwd()
if os.path.exists(os.path.join(possible_topdir, "nova", "__init__.py")): if os.path.exists(os.path.join(possible_topdir, "nova", "__init__.py")):
sys.path.insert(0, possible_topdir) sys.path.insert(0, possible_topdir)
from nova import config
from nova import context from nova import context
from nova import db from nova import db
from nova import exception from nova import exception
# NOTE(philip-schwartz) Added service import to fix issue where importing
# xenapi service would cause an ArgsAlreadyParsedError exception
from nova import service
from nova.openstack.common import timeutils from nova.openstack.common import timeutils
from nova.virt import virtapi from nova.virt import virtapi
from nova.virt.xenapi import driver as xenapi_driver from nova.virt.xenapi import driver as xenapi_driver
@ -285,6 +290,7 @@ def clean_orphaned_instances(xenapi, orphaned_instances):
def main(): def main():
"""Main loop.""" """Main loop."""
config.parse_args(sys.argv)
args = CONF(args=sys.argv[1:], usage='%(prog)s [options] --command={' + args = CONF(args=sys.argv[1:], usage='%(prog)s [options] --command={' +
'|'.join(ALLOWED_COMMANDS) + '}') '|'.join(ALLOWED_COMMANDS) + '}')