summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2014-02-18 07:48:07 +0000
committerMark McLoughlin <markmc@redhat.com>2014-03-25 06:44:50 -0400
commit0861fc2d22ae40b82dfe6fc0469db84339464923 (patch)
treec65125cab8a23507d4527887bd294925f45b13b4 /tools
parentf5eb59b89741b31ba51ca8a485a13e3fcb796728 (diff)
downloadnova-0861fc2d22ae40b82dfe6fc0469db84339464923.tar.gz
Re-work how debugger CLI opts are registered
CLI options must be registered before the command line is parsed or a cfg.ArgsAlreadyParsedError is raised. Since commit 2cbea24 we are registering two 'remote_debug' arguments in nova.service. In commit b506529, we see a hack being added to ensure that nova.service is imported and the CLI opts registered before config.parse_args() is called. To clean this up somewhat, refactor all the elements of this remote debugger support into nova.debugger. Avoid importing modules at module import time since we need to import this before monkey patching. Add a function for registering the CLI options just before config.parse_args() is called. And fail gracefully if the CLI options aren't registered when we called debugger.init(). Note that because the options aren't registered at module import time any more, the config generator doesn't pick them up. However, that's actually a good thing since this support doesn't work if you enable it via config files since debugger.enabled() only looks at the command line. DocImpact: remote_debug options are not available via the config file, only via the command line. Change-Id: I97f747a2fb9222137203657df1d86ba89f3219e2
Diffstat (limited to 'tools')
-rwxr-xr-xtools/xenserver/vm_vdi_cleaner.py5
1 files changed, 0 insertions, 5 deletions
diff --git a/tools/xenserver/vm_vdi_cleaner.py b/tools/xenserver/vm_vdi_cleaner.py
index 58f693aa21..b460e51c99 100755
--- a/tools/xenserver/vm_vdi_cleaner.py
+++ b/tools/xenserver/vm_vdi_cleaner.py
@@ -31,11 +31,6 @@ from nova import config
from nova import context
from nova import db
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.virt import virtapi
from nova.virt.xenapi import driver as xenapi_driver