From 398f954905decf98d0a059d401cd4288e8bb4e66 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Tue, 7 Mar 2017 15:42:57 -0500 Subject: [PATCH] Ignore os-cloud-config deprecation warning tripleoclient users really have no control over whether the code imports os-cloud-config or not and shows a deprecation warning. We still have to rely on os-cloud-config in case someone is deploying old templates. But in the meantime, we should not spam the user with the deprecation warning every time they use tripleoclient. Change-Id: I54e4c6f117c587fee05fcd5fc3f5c9feee61785f Closes-Bug: #1670817 --- tripleoclient/v1/overcloud_deploy.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tripleoclient/v1/overcloud_deploy.py b/tripleoclient/v1/overcloud_deploy.py index 0f7589d6e..c16195ff6 100644 --- a/tripleoclient/v1/overcloud_deploy.py +++ b/tripleoclient/v1/overcloud_deploy.py @@ -30,8 +30,6 @@ import yaml from heatclient.common import template_utils from heatclient import exc as hc_exc from keystoneclient import exceptions as kscexc -from os_cloud_config import keystone -from os_cloud_config.utils import clients as occ_clients from osc_lib.command import command from osc_lib import exceptions as oscexc from osc_lib.i18n import _ @@ -47,6 +45,13 @@ from tripleoclient.workflows import parameters as workflow_params from tripleoclient.workflows import plan_management +level = logging.getLogger('os_cloud_config').getEffectiveLevel() +logging.getLogger('os_cloud_config').setLevel(logging.ERROR) +from os_cloud_config import keystone +from os_cloud_config.utils import clients as occ_clients +logging.getLogger('os_cloud_config').setLevel(level) + + class DeployOvercloud(command.Command): """Deploy Overcloud"""