diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-20 16:40:16 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-20 16:40:16 -0700 |
commit | 27349ea69b8ccd3eace67e2b71ae8842e8001020 (patch) | |
tree | 9f97613fc121fe86a0e7dac50ab39037f2dd605e /cloudinit | |
parent | 7f5f2c1a9396cb24a97c412fbe3422f10e485b46 (diff) | |
download | vyos-cloud-init-27349ea69b8ccd3eace67e2b71ae8842e8001020.tar.gz vyos-cloud-init-27349ea69b8ccd3eace67e2b71ae8842e8001020.zip |
Change to import error instead of runtime error.
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/sources/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cloudinit/sources/__init__.py b/cloudinit/sources/__init__.py index 35fc01df..8ab7cf54 100644 --- a/cloudinit/sources/__init__.py +++ b/cloudinit/sources/__init__.py @@ -198,11 +198,13 @@ def list_sources(cfg_list, depends, pkg_list): for pkg in pkg_list: pkg_name = [] if pkg: + # Any package name given, this affects + # the lookup path pkg_name.append(str(pkg)) pkg_name.append(ds_name) try: mod = importer.import_module(".".join(pkg_name)) - except RuntimeError: + except ImportError: continue lister = getattr(mod, "get_datasource_list", None) if not lister: |