diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-20 16:39:56 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-20 16:39:56 -0700 |
commit | 7f5f2c1a9396cb24a97c412fbe3422f10e485b46 (patch) | |
tree | fad4d04c0d6fc2e8e1a07b3da93f0642f7b2b3f5 /cloudinit/distros | |
parent | f7bfe4aaae9850ab179a39436d4b6a9c9da707a5 (diff) | |
download | vyos-cloud-init-7f5f2c1a9396cb24a97c412fbe3422f10e485b46.tar.gz vyos-cloud-init-7f5f2c1a9396cb24a97c412fbe3422f10e485b46.zip |
Catch the import error rather than the runtime error.
Diffstat (limited to 'cloudinit/distros')
-rw-r--r-- | cloudinit/distros/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py index 6a98fdb1..45dd85ec 100644 --- a/cloudinit/distros/__init__.py +++ b/cloudinit/distros/__init__.py @@ -147,10 +147,10 @@ class Distro(object): def fetch(distro_name, mods=(__name__, )): mod = None for m in mods: + mod_name = "%s.%s" % (m, distro_name) try: - mod_name = "%s.%s" % (m, distro_name) mod = importer.import_module(mod_name) - except RuntimeError: + except ImportError: pass if not mod: raise RuntimeError("No distribution found for distro %s" |