fix '-' in stage names for python imports
authorBrian Dolbec <dolsen@gentoo.org>
Tue, 11 Jun 2013 16:07:03 +0000 (09:07 -0700)
committerBrian Dolbec <dolsen@gentoo.org>
Tue, 11 Jun 2013 16:07:03 +0000 (09:07 -0700)
catalyst/main.py

index 26e0c8b3523741d991a90e3954fbee1b69449b72..3f37ad0bbf8ccfa6bd843d5f8c8e985aa34e34ff 100644 (file)
@@ -157,11 +157,12 @@ def import_module(target):
 
 def build_target(addlargs):
        try:
-               module = import_module(addlargs["target"])
-               target = getattr(module, addlargs["target"])(conf_values, addlargs)
+               target = addlargs["target"].replace('-', '_')
+               module = import_module(target)
+               target = getattr(module, target)(conf_values, addlargs)
        except AttributeError:
                raise CatalystError(
-                       "Target \"%s\" not available." % addlargs["target"],
+                       "Target \"%s\" not available." % target,
                        print_traceback=True)
 
        try: