diff options
author | Rabi Mishra <ramishra@redhat.com> | 2016-04-22 10:42:34 +0530 |
---|---|---|
committer | marco <m.celoud@tcpcloud.eu> | 2016-06-27 21:28:56 +0200 |
commit | 56a7c6b0298f8e1b065d93da82dfd4c612b79b75 (patch) | |
tree | e219be0a8d3ac89a804439b7830780210f32c167 | |
parent | ba175f57a63b72d93b842d0711b5613e6392bfe2 (diff) | |
download | heat-56a7c6b0298f8e1b065d93da82dfd4c612b79b75.tar.gz |
Fix heat-keystone-setup-domain
Change I4209f3bcc56467b6eb50a794694fe8d1da780161 to use oslo.log
has broken the heat-keystone-setup-domain script. This patch
fixes it.
Change-Id: Ib98a453803d9fd2bf31056e8c9b49b84b2e7e715
Closes-Bug: #1573368
(cherry picked from commit 6b8f1ae5a654d2e707fba2a24ab363801898517d)
-rwxr-xr-x | bin/heat-keystone-setup-domain | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/bin/heat-keystone-setup-domain b/bin/heat-keystone-setup-domain index dc502fc51..f8ce07454 100755 --- a/bin/heat-keystone-setup-domain +++ b/bin/heat-keystone-setup-domain @@ -55,6 +55,18 @@ opts = [ ] +# Setup logging before registering additional options +logging.register_options(cfg.CONF) +extra_log_level_defaults = ['urllib3.connectionpool=WARNING'] +logging.set_defaults( + logging_context_format_string="%(levelname)s (%(module)s:" + "%(lineno)d) %(message)s", + default_log_levels=(logging.get_default_log_levels() + + extra_log_level_defaults)) +logging.setup(cfg.CONF, 'heat-keystone-setup-domain', + version.version_info.version_string()) + +# Register additional options cfg.CONF.register_cli_opts(opts) cfg.CONF(sys.argv[1:], project='heat', @@ -79,12 +91,6 @@ insecure = cfg.CONF.insecure def main(): - log_lvl = logging.DEBUG if DEBUG else logging.WARNING - logging.basicConfig( - format="%(levelname)s (%(module)s:%(lineno)d) %(message)s", - level=log_lvl) - logging.getLogger('urllib3.connectionpool').setLevel(logging.WARNING) - client_kwargs = { 'debug': DEBUG, 'username': USERNAME, |