Log exceptions that are uncaught

Since openstackclient usually eats the exceptions, we should at least
print any that manage to not be caught.  We've seen this in the past
where a deploy is run and the last output is 'password'.

Change-Id: I3b298ebe60a278c68fa582c47f36f87a94f9f2f8
Closes-Bug: #1734704
This commit is contained in:
Alex Schultz 2018-10-09 09:51:41 -06:00
parent 71f51369a0
commit a022a339be
1 changed files with 9 additions and 3 deletions

View File

@ -12,17 +12,23 @@
# License for the specific language governing permissions and limitations
# under the License.
import logging
from osc_lib.command import command
from tripleoclient import utils
class Command(command.Command):
log = logging.getLogger(__name__ + ".Command")
def run(self, parsed_args):
utils.store_cli_param(self.cmd_name, parsed_args)
super(Command, self).run(parsed_args)
try:
super(Command, self).run(parsed_args)
except Exception:
self.log.exception("Exception occured while running the command")
raise
class Lister(Command, command.Lister):