diff options
author | ChangBo Guo(gcb) <eric.guo@easystack.cn> | 2017-02-10 19:54:54 +0800 |
---|---|---|
committer | ChangBo Guo(gcb) <eric.guo@easystack.cn> | 2017-02-27 10:02:45 +0800 |
commit | 6b73c281bcbde20acb00386bbe4c0d4d1c501a04 (patch) | |
tree | a735a1b526ad2a48d2c87af70ad46e83876c6c05 /tools | |
parent | 8b498ce199ac4acd94eb33a7f47c05ee0c743c34 (diff) | |
download | nova-6b73c281bcbde20acb00386bbe4c0d4d1c501a04.tar.gz |
Remove usage of config option verbose
oslo.log deprecate config option verbose since aug 1, 2015 in review:
in https://review.openstack.org/#/c/206437/
That was a long time ago so it should be possible to remove it now. This
was already merged once but had to be reverted because some projects
were still relying on it. Oslo team plan to remove it, so we need clean
up its usage before removing it.
Closes-Bug: #1663570
Change-Id: I072e1078486f50cebea92695ff46c1af879eb23d
Diffstat (limited to 'tools')
-rw-r--r-- | tools/xenserver/populate_other_config.py | 7 | ||||
-rwxr-xr-x | tools/xenserver/vm_vdi_cleaner.py | 25 |
2 files changed, 9 insertions, 23 deletions
diff --git a/tools/xenserver/populate_other_config.py b/tools/xenserver/populate_other_config.py index f99ed29816..8613ddfb0b 100644 --- a/tools/xenserver/populate_other_config.py +++ b/tools/xenserver/populate_other_config.py @@ -28,7 +28,7 @@ populated. Run on compute-worker (not Dom0): - python ./tools/xenserver/populate_other_config.py [--dry-run|--verbose] + python ./tools/xenserver/populate_other_config.py [--dry-run] """ import os import sys @@ -92,9 +92,8 @@ def main(): vm_utils._set_vdi_info(session, vdi_ref, vdi_type, name_label, vdi_type, instance) - if CONF.verbose: - print("Setting other_config for instance_uuid=%s vdi_uuid=%s" % ( - instance_uuid, vdi_rec['uuid'])) + print("Setting other_config for instance_uuid=%s vdi_uuid=%s" % ( + instance_uuid, vdi_rec['uuid'])) if CONF.dry_run: print("Dry run completed") diff --git a/tools/xenserver/vm_vdi_cleaner.py b/tools/xenserver/vm_vdi_cleaner.py index 0c8a5d013b..6d868b2025 100755 --- a/tools/xenserver/vm_vdi_cleaner.py +++ b/tools/xenserver/vm_vdi_cleaner.py @@ -49,7 +49,6 @@ cli_opt = cfg.StrOpt('command', CONF = nova.conf.CONF CONF.register_opts(cleaner_opts) CONF.register_cli_opt(cli_opt) -CONF.import_opt('verbose', 'nova.openstack.common.log') ALLOWED_COMMANDS = ["list-vdis", "clean-vdis", "list-instances", @@ -123,8 +122,6 @@ def print_xen_object(obj_type, obj, indent_level=0, spaces_per_indent=4): VM (abcd-abcd-abcd): 'name label here' """ - if not CONF.verbose: - return uuid = obj["uuid"] try: name_label = obj["name_label"] @@ -246,17 +243,13 @@ def find_orphaned_vdi_uuids(xenapi): def list_orphaned_vdis(vdi_uuids): """List orphaned VDIs.""" for vdi_uuid in vdi_uuids: - if CONF.verbose: - print("ORPHANED VDI (%s)" % vdi_uuid) - else: - print(vdi_uuid) + print("ORPHANED VDI (%s)" % vdi_uuid) def clean_orphaned_vdis(xenapi, vdi_uuids): """Clean orphaned VDIs.""" for vdi_uuid in vdi_uuids: - if CONF.verbose: - print("CLEANING VDI (%s)" % vdi_uuid) + print("CLEANING VDI (%s)" % vdi_uuid) vdi_ref = call_xenapi(xenapi, 'VDI.get_by_uuid', vdi_uuid) try: @@ -268,17 +261,13 @@ def clean_orphaned_vdis(xenapi, vdi_uuids): def list_orphaned_instances(orphaned_instances): """List orphaned instances.""" for vm_ref, vm_rec, orphaned_instance in orphaned_instances: - if CONF.verbose: - print("ORPHANED INSTANCE (%s)" % orphaned_instance.name) - else: - print(orphaned_instance.name) + print("ORPHANED INSTANCE (%s)" % orphaned_instance.name) def clean_orphaned_instances(xenapi, orphaned_instances): """Clean orphaned instances.""" for vm_ref, vm_rec, instance in orphaned_instances: - if CONF.verbose: - print("CLEANING INSTANCE (%s)" % instance.name) + print("CLEANING INSTANCE (%s)" % instance.name) cleanup_instance(xenapi, instance, vm_ref, vm_rec) @@ -303,11 +292,9 @@ def main(): xenapi = xenapi_driver.XenAPIDriver(virtapi.VirtAPI()) if command == "list-vdis": - if CONF.verbose: - print("Connected VDIs:\n") + print("Connected VDIs:\n") orphaned_vdi_uuids = find_orphaned_vdi_uuids(xenapi) - if CONF.verbose: - print("\nOrphaned VDIs:\n") + print("\nOrphaned VDIs:\n") list_orphaned_vdis(orphaned_vdi_uuids) elif command == "clean-vdis": orphaned_vdi_uuids = find_orphaned_vdi_uuids(xenapi) |