Fix incorrect exception handling (pass without any log record) by adding log record
Use `logger.warning('Ignoring exception: {!r}'.format(e))` as exception hadnler in `pass` places Closes-bug: #1551130 Change-Id: I27d9b9901b1ec382533c43b1f18ee72b996c08d8
This commit is contained in:
parent
026e9c6b61
commit
fae4f24153
|
@ -13,6 +13,7 @@
|
|||
# under the License.
|
||||
|
||||
import time
|
||||
import traceback
|
||||
from urlparse import urlparse
|
||||
|
||||
from cinderclient import client as cinderclient
|
||||
|
@ -150,8 +151,9 @@ class Common(object):
|
|||
else:
|
||||
image = [i.id for i in self.nova.images.list()]
|
||||
break
|
||||
except:
|
||||
pass
|
||||
except Exception as e:
|
||||
logger.warning('Ignoring exception: {!r}'.format(e))
|
||||
logger.debug(traceback.format_exc())
|
||||
else:
|
||||
raise Exception('Can not get image')
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
import os
|
||||
import re
|
||||
import sys
|
||||
import traceback
|
||||
import yaml
|
||||
import zlib
|
||||
from urllib2 import urlopen
|
||||
|
@ -222,8 +223,9 @@ def get_package_test_info(package, pkg_type, tests_path, patch_target):
|
|||
test = yaml.load(open(path).read())
|
||||
if 'system_tests' in test.keys():
|
||||
tests.update(test['system_tests']['tags'])
|
||||
except IOError:
|
||||
pass
|
||||
except IOError as e:
|
||||
logger.warning('Ignoring exception: {!r}'.format(e))
|
||||
logger.debug(traceback.format_exc())
|
||||
return tests
|
||||
|
||||
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
# under the License.
|
||||
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from proboscis.asserts import assert_true
|
||||
from proboscis import test
|
||||
from proboscis import SkipTest
|
||||
|
||||
|
||||
from fuelweb_test import logger
|
||||
from fuelweb_test.helpers.decorators import log_snapshot_after_test
|
||||
from fuelweb_test.helpers.decorators import upload_manifests
|
||||
|
@ -49,9 +49,10 @@ class NeutronTun(TestBasic):
|
|||
test_group = sys.argv[-1]
|
||||
try:
|
||||
self.check_run(snapshot_name=snapshot_name)
|
||||
except SkipTest:
|
||||
except SkipTest as e:
|
||||
if expected_group in test_group:
|
||||
pass
|
||||
logger.warning('Ignoring exception: {!r}'.format(e))
|
||||
logger.debug(traceback.format_exc())
|
||||
else:
|
||||
raise
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
# under the License.
|
||||
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from proboscis.asserts import assert_true
|
||||
from proboscis import test
|
||||
|
@ -49,9 +50,10 @@ class NeutronVlanCephMongo(TestBasic):
|
|||
test_group = sys.argv[-1]
|
||||
try:
|
||||
self.check_run(snapshot_name=snapshot_name)
|
||||
except SkipTest:
|
||||
except SkipTest as e:
|
||||
if expected_group in test_group:
|
||||
pass
|
||||
logger.warning('Ignoring exception: {!r}'.format(e))
|
||||
logger.debug(traceback.format_exc())
|
||||
else:
|
||||
raise
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
from ipaddr import IPAddress
|
||||
import random
|
||||
import time
|
||||
import traceback
|
||||
|
||||
from devops.helpers import helpers
|
||||
from proboscis import asserts
|
||||
|
@ -23,6 +24,7 @@ from proboscis import test
|
|||
from fuelweb_test.helpers.decorators import log_snapshot_after_test
|
||||
from fuelweb_test.helpers import os_actions
|
||||
from fuelweb_test.helpers import utils
|
||||
from fuelweb_test import logger
|
||||
from fuelweb_test import settings
|
||||
from fuelweb_test.tests.base_test_case import SetupEnvironment
|
||||
from fuelweb_test.tests.base_test_case import TestBasic
|
||||
|
@ -81,7 +83,8 @@ class ServicesReconfiguration(TestBasic):
|
|||
except Exception as e:
|
||||
if e.code != expected_code:
|
||||
raise e
|
||||
pass
|
||||
logger.warning('Ignoring exception: {!r}'.format(e))
|
||||
logger.debug(traceback.format_exc())
|
||||
else:
|
||||
raise Exception(err_msg)
|
||||
|
||||
|
@ -246,7 +249,8 @@ class ServicesReconfiguration(TestBasic):
|
|||
except Exception as e:
|
||||
if 'No tenant network is available' not in e.message:
|
||||
raise e
|
||||
pass
|
||||
logger.warning('Ignoring exception: {!r}'.format(e))
|
||||
logger.debug(traceback.format_exc())
|
||||
else:
|
||||
raise Exception("New configuration was not applied")
|
||||
|
||||
|
@ -270,7 +274,8 @@ class ServicesReconfiguration(TestBasic):
|
|||
except Exception as e:
|
||||
if 'Quota exceeded for instances' not in e.message:
|
||||
raise e
|
||||
pass
|
||||
logger.warning('Ignoring exception: {!r}'.format(e))
|
||||
logger.debug(traceback.format_exc())
|
||||
else:
|
||||
raise Exception("New configuration was not applied")
|
||||
|
||||
|
@ -289,7 +294,8 @@ class ServicesReconfiguration(TestBasic):
|
|||
except Exception as e:
|
||||
if e.http_status != 404:
|
||||
raise e
|
||||
pass
|
||||
logger.warning('Ignoring exception: {!r}'.format(e))
|
||||
logger.debug(traceback.format_exc())
|
||||
else:
|
||||
raise Exception("New configuration was not applied")
|
||||
|
||||
|
@ -524,8 +530,9 @@ class ServicesReconfiguration(TestBasic):
|
|||
self.show_step(4)
|
||||
try:
|
||||
self.fuel_web.assert_task_success(task, timeout=3600, interval=30)
|
||||
except AssertionError:
|
||||
pass
|
||||
except AssertionError as e:
|
||||
logger.warning('Ignoring exception: {!r}'.format(e))
|
||||
logger.debug(traceback.format_exc())
|
||||
else:
|
||||
raise Exception("New configuration was not applied")
|
||||
|
||||
|
|
Loading…
Reference in New Issue