]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
windows: don't use LOG.exception if not logging an exception
authorMatt Riedemann <mriedem@us.ibm.com>
Mon, 12 Oct 2015 13:44:14 +0000 (06:44 -0700)
committerMatt Riedemann <mriedem@us.ibm.com>
Wed, 14 Oct 2015 16:33:58 +0000 (09:33 -0700)
commit3522711b3e699e3dbc5c260b0f3f9ad6ea2d4ed7
tree082cc532d6774d25af726a6a8d5e761640cb08d7
parent71932e9c4f0d0fe8dfb6400992b4e5be0215221f
windows: don't use LOG.exception if not logging an exception

There is a bug in python 3.4 such that if you call LOG.exception and
you're not in a logging handler context it fails. That bug is fixed
inadvertantly in python 3.5 under:

http://bugs.python.org/issue17911

This fixes the instance in the windows vhdutils module to use LOG.error
rather than LOG.exception to avoid that logging error.

Since LOG.exception was being used I'm assuming the original author wanted
traceback given this is a utility method, so we use the exc_info kwarg which
will log a traceback if there is one.

Closes-Bug: #1505240

Change-Id: Ib3113f2c4752d37e890f97d259da5d51cbfcfb96
cinder/tests/unit/windows/test_vhdutils.py
cinder/volume/drivers/windows/vhdutils.py