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
This commit is contained in:
ChangBo Guo(gcb) 2017-02-10 19:54:54 +08:00
parent 8b498ce199
commit 6b73c281bc
10 changed files with 12 additions and 34 deletions

View File

@ -29,7 +29,7 @@ are in the ``nova.conf`` file in a separate ``trust`` section. For example,
the config file will look something like:
[DEFAULT]
verbose=True
debug=True
...
[trust]
server=attester.mynetwork.com

View File

@ -769,7 +769,6 @@ class OSAPIFixture(fixtures.Fixture):
conf_overrides = {
'osapi_compute_listen': '127.0.0.1',
'osapi_compute_listen_port': 0,
'verbose': True,
'debug': True,
}
self.useFixture(ConfPatcher(**conf_overrides))
@ -805,7 +804,6 @@ class OSMetadataServer(fixtures.Fixture):
conf_overrides = {
'metadata_listen': '127.0.0.1',
'metadata_listen_port': 0,
'verbose': True,
'debug': True
}
self.useFixture(ConfPatcher(**conf_overrides))

View File

@ -72,7 +72,6 @@ class _IntegratedTestBase(test.TestCase):
def setUp(self):
super(_IntegratedTestBase, self).setUp()
self.flags(verbose=True)
# TODO(mriedem): Fix the functional tests to work with Neutron.
self.flags(use_neutron=self.USE_NEUTRON)

View File

@ -123,7 +123,6 @@ def stub_instance(id, user_id='fake', project_id='fake', host=None,
class ConsolesControllerTestV21(test.NoDBTestCase):
def setUp(self):
super(ConsolesControllerTestV21, self).setUp()
self.flags(verbose=True)
self.instance_db = FakeInstanceDB()
self.stub_out('nova.db.instance_get',
self.instance_db.return_server_by_id)

View File

@ -35,7 +35,7 @@ class FpingTestV21(test.TestCase):
def setUp(self):
super(FpingTestV21, self).setUp()
self.flags(verbose=True, use_ipv6=False)
self.flags(use_ipv6=False)
return_server = fakes.fake_instance_get()
return_servers = fakes.fake_instance_get_all_by_filters()
self.stub_out("nova.db.instance_get_all_by_filters",

View File

@ -41,7 +41,6 @@ class MultiCreateExtensionTestV21(test.TestCase):
"""Shared implementation for tests below that create instance."""
super(MultiCreateExtensionTestV21, self).setUp()
self.flags(verbose=True)
self.flags(enable_instance_password=True, group='api')
self.instance_cache_num = 0
self.instance_cache_by_id = {}

View File

@ -158,7 +158,7 @@ class ControllerTest(test.TestCase):
def setUp(self):
super(ControllerTest, self).setUp()
self.flags(verbose=True, use_ipv6=False)
self.flags(use_ipv6=False)
fakes.stub_out_key_pair_funcs(self)
fake.stub_out_image_service(self)
return_server = fakes.fake_compute_get()
@ -2520,7 +2520,6 @@ class ServersControllerCreateTest(test.TestCase):
"""Shared implementation for tests below that create instance."""
super(ServersControllerCreateTest, self).setUp()
self.flags(verbose=True)
self.flags(enable_instance_password=True, group='api')
self.instance_cache_num = 0
self.instance_cache_by_id = {}
@ -3835,7 +3834,6 @@ class ServersControllerCreateTestWithMock(test.TestCase):
"""Shared implementation for tests below that create instance."""
super(ServersControllerCreateTestWithMock, self).setUp()
self.flags(verbose=True)
self.flags(enable_instance_password=True, group='api')
self.instance_cache_num = 0
self.instance_cache_by_id = {}

View File

@ -53,7 +53,6 @@ class ServersControllerCreateTest(test.TestCase):
"""Shared implementation for tests below that create instance."""
super(ServersControllerCreateTest, self).setUp()
self.flags(verbose=True)
self.flags(enable_instance_password=True, group='api')
self.instance_cache_num = 0
self.instance_cache_by_id = {}

View File

@ -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")

View File

@ -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)