fix '-' in stage names for python imports
authorBrian Dolbec <dolsen@gentoo.org>
Tue, 11 Jun 2013 16:07:03 +0000 (09:07 -0700)
committerW. Trevor King <wking@tremily.us>
Sun, 15 Dec 2013 04:25:09 +0000 (20:25 -0800)
catalyst/main.py

index 9ca33ecef36872aa5cead54d4359233b22e62e03..8c54849ae0494be8df3694a9011108a4ea8137d7 100755 (executable)
@@ -155,11 +155,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: