Skip to content

Commit 2ea6f10

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Suppress warnings user can't fix"
2 parents fbb7641 + ec4ef5f commit 2ea6f10

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎openstackclient/shell.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright 2012-2013 OpenStack Foundation
2+
# Copyright 2015 Dean Troyer
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License"); you may
45
# not use this file except in compliance with the License. You may obtain
@@ -19,6 +20,7 @@
1920
import logging
2021
import sys
2122
import traceback
23+
import warnings
2224

2325
from cliff import app
2426
from cliff import command
@@ -111,12 +113,15 @@ def configure_logging(self):
111113
if self.options.verbose_level == 0:
112114
# --quiet
113115
root_logger.setLevel(logging.ERROR)
116+
warnings.simplefilter("ignore")
114117
elif self.options.verbose_level == 1:
115118
# This is the default case, no --debug, --verbose or --quiet
116119
root_logger.setLevel(logging.WARNING)
120+
warnings.simplefilter("ignore")
117121
elif self.options.verbose_level == 2:
118122
# One --verbose
119123
root_logger.setLevel(logging.INFO)
124+
warnings.simplefilter("once")
120125
elif self.options.verbose_level >= 3:
121126
# Two or more --verbose
122127
root_logger.setLevel(logging.DEBUG)

0 commit comments

Comments
 (0)