diff options
author | Ross Brattain <ross.b.brattain@intel.com> | 2017-06-05 08:31:46 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-06-05 08:31:46 +0000 |
commit | 1f5e2b8f41417d38ae06af1f52cbbc123c0986e3 (patch) | |
tree | df8f0a2653b382a8034890330e880639d82aa1f2 | |
parent | a8ad5e87de3127bc5fbb4979b2e5728f80e8e454 (diff) | |
parent | aa63d13770d6417963afff7d5304dee04c3d35a1 (diff) |
Merge "utils: make module import safer"
-rw-r--r-- | yardstick/common/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/yardstick/common/utils.py b/yardstick/common/utils.py index f4def8533..7aab46942 100644 --- a/yardstick/common/utils.py +++ b/yardstick/common/utils.py @@ -81,7 +81,10 @@ def import_modules_from_package(package): continue new_package = ".".join(root.split(os.sep)).split("....")[1] module_name = "%s.%s" % (new_package, filename[:-3]) - try_append_module(module_name, sys.modules) + try: + try_append_module(module_name, sys.modules) + except ImportError: + logger.exception("unable to import %s", module_name) def parse_yaml(file_path): |