From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C052D1389E2 for ; Thu, 1 Jan 2015 05:59:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DF049E0898; Thu, 1 Jan 2015 05:59:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BA5F3E088A for ; Thu, 1 Jan 2015 05:59:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AD51F3406B0 for ; Thu, 1 Jan 2015 05:59:06 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C2D1AE9EA for ; Thu, 1 Jan 2015 05:59:03 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1420091885.11423a21603ed6ab4cdf8e1662512b9d275345bc.dolsen@gentoo> Subject: [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/main.py catalyst/targets/embedded_target.py catalyst/targets/grp_target.py catalyst/targets/livecd_stage1_target.py catalyst/targets/livecd_stage2_target.py catalyst/targets/netboot2_target.py catalyst/targets/netboot_target.py catalyst/targets/snapshot.py catalyst/targets/snapshot_target.py catalyst/targets/stage1_target.py catalyst/targets/stage2_target.py catalyst/targets/stage3_target.py catalyst/targets/stage4_target.py catalyst/targets/tinderbox_target.py X-VCS-Directories: catalyst/ catalyst/targets/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 11423a21603ed6ab4cdf8e1662512b9d275345bc X-VCS-Branch: pending Date: Thu, 1 Jan 2015 05:59:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a03fa432-9e23-4978-bf5d-a5c54a56115a X-Archives-Hash: 89640d5a0887ce95659b6b01ea8ae842 commit: 11423a21603ed6ab4cdf8e1662512b9d275345bc Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 20 21:50:23 2013 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Thu Jan 1 05:58:05 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=11423a21 [2 of 3] Update module loading for the new python structure Rename snapshot_target to snapshot --- catalyst/main.py | 75 ++++++++-------------- catalyst/targets/embedded_target.py | 4 -- catalyst/targets/grp_target.py | 4 -- catalyst/targets/livecd_stage1_target.py | 4 -- catalyst/targets/livecd_stage2_target.py | 4 -- catalyst/targets/netboot2_target.py | 4 -- catalyst/targets/netboot_target.py | 4 -- .../targets/{snapshot_target.py => snapshot.py} | 6 +- catalyst/targets/stage1_target.py | 4 -- catalyst/targets/stage2_target.py | 4 -- catalyst/targets/stage3_target.py | 4 -- catalyst/targets/stage4_target.py | 5 -- catalyst/targets/tinderbox_target.py | 4 -- 13 files changed, 27 insertions(+), 99 deletions(-) diff --git a/catalyst/main.py b/catalyst/main.py index 15664de..1446cf9 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -16,21 +16,20 @@ import os.path __selfpath__ = os.path.abspath(os.path.dirname(__file__)) -sys.path.append(__selfpath__ + "/modules") from . import __version__ import catalyst.config import catalyst.util +from catalyst.contents import ContentsMap, CONTENTS_DEFINITIONS +from catalyst.defaults import confdefaults, option_messages +from catalyst.hash_utils import HashMap, HASH_DEFINITIONS from catalyst.lock import LockInUse from catalyst.support import CatalystError, find_binary -from catalyst.defaults import (confdefaults, option_messages, - required_build_targets, valid_build_targets) -from hash_utils import HashMap, HASH_DEFINITIONS -from contents import ContentsMap, CONTENTS_DEFINITIONS conf_values={} + def usage(): print """Usage catalyst [options] [-C variable=value...] [ -s identifier] -a --clear-autoresume clear autoresume flags @@ -135,59 +134,40 @@ def parse_config(myconfig): print "Envscript support enabled." -def import_modules(): - # import catalyst's own modules - # (i.e. stage and the arch modules) - targetmap={} - +def import_module(target): + """ + import catalyst's own modules + (i.e. targets and the arch modules) + """ try: - module_dir = __selfpath__ + "/targets/" - for x in required_build_targets: - try: - fh=open(module_dir + x + ".py") - module=imp.load_module(x, fh,"targets/" + x + ".py", - (".py", "r", imp.PY_SOURCE)) - fh.close() - - except IOError: - raise CatalystError, "Can't find " + x + ".py plugin in " + \ - module_dir - for x in valid_build_targets: - try: - fh=open(module_dir + x + ".py") - module=imp.load_module(x, fh, "targets/" + x + ".py", - (".py", "r", imp.PY_SOURCE)) - module.register(targetmap) - fh.close() - - except IOError: - raise CatalystError,"Can't find " + x + ".py plugin in " + \ - module_dir - + mod_name = "catalyst.targets." + target + module = __import__(mod_name, [],[], ["not empty"]) except ImportError as e: - print "!!! catalyst: Python modules not found in "+\ - module_dir + "; exiting." - print e + print "!!! catalyst: Python module import error: %s " % target + \ + "in catalyst/targets/ ... exiting." + print "ERROR was: ", e sys.exit(1) + return module - return targetmap -def build_target(addlargs, targetmap): +def build_target(addlargs): try: - if addlargs["target"] not in targetmap: - raise CatalystError,"Target \""+addlargs["target"]+"\" not available." - - mytarget=targetmap[addlargs["target"]](conf_values, addlargs) - - mytarget.run() + module = import_module(addlargs["target"]) + target = getattr(module, addlargs["target"])(conf_values, addlargs) + except AttributeError: + raise CatalystError( + "Target \"%s\" not available." % addlargs["target"], + print_traceback=True) + try: + target.run() except: + print "Target run() exception: Python traceback output follows:" catalyst.util.print_traceback() print "!!! catalyst: Error encountered during run of target " + addlargs["target"] sys.exit(1) def main(): - targetmap={} version() if os.getuid() != 0: @@ -341,9 +321,6 @@ def main(): print "Catalyst aborting...." sys.exit(2) - # import the rest of the catalyst modules - targetmap=import_modules() - addlargs={} if myspecfile: @@ -364,7 +341,7 @@ def main(): # everything is setup, so the build is a go try: - build_target(addlargs, targetmap) + build_target(addlargs) except CatalystError: print diff --git a/catalyst/targets/embedded_target.py b/catalyst/targets/embedded_target.py index 528d545..aee0f00 100644 --- a/catalyst/targets/embedded_target.py +++ b/catalyst/targets/embedded_target.py @@ -45,7 +45,3 @@ class embedded_target(StageBase): def set_root_path(self): self.settings["root_path"]=normpath("/tmp/mergeroot") print "embedded root path is "+self.settings["root_path"] - -def register(foo): - foo.update({"embedded":embedded_target}) - return foo diff --git a/catalyst/targets/grp_target.py b/catalyst/targets/grp_target.py index deba80a..e3f08a2 100644 --- a/catalyst/targets/grp_target.py +++ b/catalyst/targets/grp_target.py @@ -118,7 +118,3 @@ class grp_target(StageBase): "config_profile_link","setup_confdir","portage_overlay","bind","chroot_setup",\ "setup_environment","run_local","unbind",\ "generate_digests","clear_autoresume"] - -def register(foo): - foo.update({"grp":grp_target}) - return foo diff --git a/catalyst/targets/livecd_stage1_target.py b/catalyst/targets/livecd_stage1_target.py index a19f4ac..9c74253 100644 --- a/catalyst/targets/livecd_stage1_target.py +++ b/catalyst/targets/livecd_stage1_target.py @@ -76,7 +76,3 @@ class livecd_stage1_target(StageBase): self.settings["pkgcache_path"]=normpath(string.join(self.settings["pkgcache_path"])) else: StageBase.set_pkgcache_path(self) - -def register(foo): - foo.update({"livecd-stage1":livecd_stage1_target}) - return foo diff --git a/catalyst/targets/livecd_stage2_target.py b/catalyst/targets/livecd_stage2_target.py index e7ae212..a4630e6 100644 --- a/catalyst/targets/livecd_stage2_target.py +++ b/catalyst/targets/livecd_stage2_target.py @@ -145,7 +145,3 @@ class livecd_stage2_target(StageBase): "unbind","remove","empty","target_setup",\ "setup_overlay","create_iso"] self.settings["action_sequence"].append("clear_autoresume") - -def register(foo): - foo.update({"livecd-stage2":livecd_stage2_target}) - return foo diff --git a/catalyst/targets/netboot2_target.py b/catalyst/targets/netboot2_target.py index 987afd8..130e2b6 100644 --- a/catalyst/targets/netboot2_target.py +++ b/catalyst/targets/netboot2_target.py @@ -167,7 +167,3 @@ class netboot2_target(StageBase): "setup_environment","build_packages","root_overlay",\ "copy_files_to_image","setup_overlay","build_kernel","move_kernels",\ "remove","empty","unbind","clean","clear_autoresume"] - -def register(foo): - foo.update({"netboot2":netboot2_target}) - return foo diff --git a/catalyst/targets/netboot_target.py b/catalyst/targets/netboot_target.py index c880289..9d92ef2 100644 --- a/catalyst/targets/netboot_target.py +++ b/catalyst/targets/netboot_target.py @@ -127,7 +127,3 @@ class netboot_target(StageBase): "setup_environment","build_packages","build_busybox",\ "build_kernel","copy_files_to_image",\ "clean","create_netboot_files","unbind","clear_autoresume"] - -def register(foo): - foo.update({"netboot":netboot_target}) - return foo diff --git a/catalyst/targets/snapshot_target.py b/catalyst/targets/snapshot.py similarity index 95% rename from catalyst/targets/snapshot_target.py rename to catalyst/targets/snapshot.py index 337ff1d..6c2396e 100644 --- a/catalyst/targets/snapshot_target.py +++ b/catalyst/targets/snapshot.py @@ -11,7 +11,7 @@ from catalyst.support import normpath, cmd from catalyst.base.targetbase import TargetBase from catalyst.base.genbase import GenBase -class snapshot_target(TargetBase, GenBase): +class snapshot(TargetBase, GenBase): """ Builder class for snapshots. """ @@ -91,7 +91,3 @@ class snapshot_target(TargetBase, GenBase): os.makedirs(myemp,0755) os.chown(myemp,mystat[ST_UID],mystat[ST_GID]) os.chmod(myemp,mystat[ST_MODE]) - -def register(foo): - foo.update({"snapshot":snapshot_target}) - return foo diff --git a/catalyst/targets/stage1_target.py b/catalyst/targets/stage1_target.py index 0a36432..2329b58 100644 --- a/catalyst/targets/stage1_target.py +++ b/catalyst/targets/stage1_target.py @@ -94,7 +94,3 @@ class stage1_target(StageBase): self.mounts.append("stage1root/proc") self.target_mounts["stage1root/proc"] = "/tmp/stage1root/proc" self.mountmap["stage1root/proc"] = "/proc" - -def register(foo): - foo.update({"stage1":stage1_target}) - return foo diff --git a/catalyst/targets/stage2_target.py b/catalyst/targets/stage2_target.py index 783d42e..ec6d78d 100644 --- a/catalyst/targets/stage2_target.py +++ b/catalyst/targets/stage2_target.py @@ -62,7 +62,3 @@ class stage2_target(StageBase): print "\tUsing an portage overlay for earlier stages could cause build issues." print "\tIf you break it, you buy it. Don't complain to us about it." print "\tDont say we did not warn you\n" - -def register(foo): - foo.update({"stage2":stage2_target}) - return foo diff --git a/catalyst/targets/stage3_target.py b/catalyst/targets/stage3_target.py index 28021b1..103242d 100644 --- a/catalyst/targets/stage3_target.py +++ b/catalyst/targets/stage3_target.py @@ -25,7 +25,3 @@ class stage3_target(StageBase): def set_cleanables(self): StageBase.set_cleanables(self) - -def register(foo): - foo.update({"stage3":stage3_target}) - return foo diff --git a/catalyst/targets/stage4_target.py b/catalyst/targets/stage4_target.py index 0d725c7..4dbdb45 100644 --- a/catalyst/targets/stage4_target.py +++ b/catalyst/targets/stage4_target.py @@ -36,8 +36,3 @@ class stage4_target(StageBase): if "fetch" not in self.settings['options']: self.settings["action_sequence"].append("capture") self.settings["action_sequence"].append("clear_autoresume") - -def register(foo): - foo.update({"stage4":stage4_target}) - return foo - diff --git a/catalyst/targets/tinderbox_target.py b/catalyst/targets/tinderbox_target.py index 1e245f2..0c389e6 100644 --- a/catalyst/targets/tinderbox_target.py +++ b/catalyst/targets/tinderbox_target.py @@ -45,7 +45,3 @@ class tinderbox_target(StageBase): "config_profile_link","setup_confdir","bind","chroot_setup",\ "setup_environment","run_local","preclean","unbind","clean",\ "clear_autoresume"] - -def register(foo): - foo.update({"tinderbox":tinderbox_target}) - return foo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 51355138A87 for ; Thu, 26 Feb 2015 04:12:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2D5BEE0A63; Thu, 26 Feb 2015 04:12:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 443F0E0A63 for ; Thu, 26 Feb 2015 04:12:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 38BA0340BF4 for ; Thu, 26 Feb 2015 04:12:06 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 550001291B for ; Thu, 26 Feb 2015 04:12:03 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1420091885.11423a21603ed6ab4cdf8e1662512b9d275345bc.dolsen@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/targets/, catalyst/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/main.py catalyst/targets/embedded_target.py catalyst/targets/grp_target.py catalyst/targets/livecd_stage1_target.py catalyst/targets/livecd_stage2_target.py catalyst/targets/netboot2_target.py catalyst/targets/netboot_target.py catalyst/targets/snapshot.py catalyst/targets/snapshot_target.py catalyst/targets/stage1_target.py catalyst/targets/stage2_target.py catalyst/targets/stage3_target.py catalyst/targets/stage4_target.py catalyst/targets/tinderbox_target.py X-VCS-Directories: catalyst/targets/ catalyst/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 11423a21603ed6ab4cdf8e1662512b9d275345bc X-VCS-Branch: master Date: Thu, 26 Feb 2015 04:12:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 41443414-1db2-4e84-adf7-46a38e38b698 X-Archives-Hash: 5011ab6c2ec7fbb4160e0e0622434861 Message-ID: <20150226041203.F98h25yyt5jKugC6j3MiOlaz6I6RIIQJM8LtojIyflU@z> commit: 11423a21603ed6ab4cdf8e1662512b9d275345bc Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 20 21:50:23 2013 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Thu Jan 1 05:58:05 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=11423a21 [2 of 3] Update module loading for the new python structure Rename snapshot_target to snapshot --- catalyst/main.py | 75 ++++++++-------------- catalyst/targets/embedded_target.py | 4 -- catalyst/targets/grp_target.py | 4 -- catalyst/targets/livecd_stage1_target.py | 4 -- catalyst/targets/livecd_stage2_target.py | 4 -- catalyst/targets/netboot2_target.py | 4 -- catalyst/targets/netboot_target.py | 4 -- .../targets/{snapshot_target.py => snapshot.py} | 6 +- catalyst/targets/stage1_target.py | 4 -- catalyst/targets/stage2_target.py | 4 -- catalyst/targets/stage3_target.py | 4 -- catalyst/targets/stage4_target.py | 5 -- catalyst/targets/tinderbox_target.py | 4 -- 13 files changed, 27 insertions(+), 99 deletions(-) diff --git a/catalyst/main.py b/catalyst/main.py index 15664de..1446cf9 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -16,21 +16,20 @@ import os.path __selfpath__ = os.path.abspath(os.path.dirname(__file__)) -sys.path.append(__selfpath__ + "/modules") from . import __version__ import catalyst.config import catalyst.util +from catalyst.contents import ContentsMap, CONTENTS_DEFINITIONS +from catalyst.defaults import confdefaults, option_messages +from catalyst.hash_utils import HashMap, HASH_DEFINITIONS from catalyst.lock import LockInUse from catalyst.support import CatalystError, find_binary -from catalyst.defaults import (confdefaults, option_messages, - required_build_targets, valid_build_targets) -from hash_utils import HashMap, HASH_DEFINITIONS -from contents import ContentsMap, CONTENTS_DEFINITIONS conf_values={} + def usage(): print """Usage catalyst [options] [-C variable=value...] [ -s identifier] -a --clear-autoresume clear autoresume flags @@ -135,59 +134,40 @@ def parse_config(myconfig): print "Envscript support enabled." -def import_modules(): - # import catalyst's own modules - # (i.e. stage and the arch modules) - targetmap={} - +def import_module(target): + """ + import catalyst's own modules + (i.e. targets and the arch modules) + """ try: - module_dir = __selfpath__ + "/targets/" - for x in required_build_targets: - try: - fh=open(module_dir + x + ".py") - module=imp.load_module(x, fh,"targets/" + x + ".py", - (".py", "r", imp.PY_SOURCE)) - fh.close() - - except IOError: - raise CatalystError, "Can't find " + x + ".py plugin in " + \ - module_dir - for x in valid_build_targets: - try: - fh=open(module_dir + x + ".py") - module=imp.load_module(x, fh, "targets/" + x + ".py", - (".py", "r", imp.PY_SOURCE)) - module.register(targetmap) - fh.close() - - except IOError: - raise CatalystError,"Can't find " + x + ".py plugin in " + \ - module_dir - + mod_name = "catalyst.targets." + target + module = __import__(mod_name, [],[], ["not empty"]) except ImportError as e: - print "!!! catalyst: Python modules not found in "+\ - module_dir + "; exiting." - print e + print "!!! catalyst: Python module import error: %s " % target + \ + "in catalyst/targets/ ... exiting." + print "ERROR was: ", e sys.exit(1) + return module - return targetmap -def build_target(addlargs, targetmap): +def build_target(addlargs): try: - if addlargs["target"] not in targetmap: - raise CatalystError,"Target \""+addlargs["target"]+"\" not available." - - mytarget=targetmap[addlargs["target"]](conf_values, addlargs) - - mytarget.run() + module = import_module(addlargs["target"]) + target = getattr(module, addlargs["target"])(conf_values, addlargs) + except AttributeError: + raise CatalystError( + "Target \"%s\" not available." % addlargs["target"], + print_traceback=True) + try: + target.run() except: + print "Target run() exception: Python traceback output follows:" catalyst.util.print_traceback() print "!!! catalyst: Error encountered during run of target " + addlargs["target"] sys.exit(1) def main(): - targetmap={} version() if os.getuid() != 0: @@ -341,9 +321,6 @@ def main(): print "Catalyst aborting...." sys.exit(2) - # import the rest of the catalyst modules - targetmap=import_modules() - addlargs={} if myspecfile: @@ -364,7 +341,7 @@ def main(): # everything is setup, so the build is a go try: - build_target(addlargs, targetmap) + build_target(addlargs) except CatalystError: print diff --git a/catalyst/targets/embedded_target.py b/catalyst/targets/embedded_target.py index 528d545..aee0f00 100644 --- a/catalyst/targets/embedded_target.py +++ b/catalyst/targets/embedded_target.py @@ -45,7 +45,3 @@ class embedded_target(StageBase): def set_root_path(self): self.settings["root_path"]=normpath("/tmp/mergeroot") print "embedded root path is "+self.settings["root_path"] - -def register(foo): - foo.update({"embedded":embedded_target}) - return foo diff --git a/catalyst/targets/grp_target.py b/catalyst/targets/grp_target.py index deba80a..e3f08a2 100644 --- a/catalyst/targets/grp_target.py +++ b/catalyst/targets/grp_target.py @@ -118,7 +118,3 @@ class grp_target(StageBase): "config_profile_link","setup_confdir","portage_overlay","bind","chroot_setup",\ "setup_environment","run_local","unbind",\ "generate_digests","clear_autoresume"] - -def register(foo): - foo.update({"grp":grp_target}) - return foo diff --git a/catalyst/targets/livecd_stage1_target.py b/catalyst/targets/livecd_stage1_target.py index a19f4ac..9c74253 100644 --- a/catalyst/targets/livecd_stage1_target.py +++ b/catalyst/targets/livecd_stage1_target.py @@ -76,7 +76,3 @@ class livecd_stage1_target(StageBase): self.settings["pkgcache_path"]=normpath(string.join(self.settings["pkgcache_path"])) else: StageBase.set_pkgcache_path(self) - -def register(foo): - foo.update({"livecd-stage1":livecd_stage1_target}) - return foo diff --git a/catalyst/targets/livecd_stage2_target.py b/catalyst/targets/livecd_stage2_target.py index e7ae212..a4630e6 100644 --- a/catalyst/targets/livecd_stage2_target.py +++ b/catalyst/targets/livecd_stage2_target.py @@ -145,7 +145,3 @@ class livecd_stage2_target(StageBase): "unbind","remove","empty","target_setup",\ "setup_overlay","create_iso"] self.settings["action_sequence"].append("clear_autoresume") - -def register(foo): - foo.update({"livecd-stage2":livecd_stage2_target}) - return foo diff --git a/catalyst/targets/netboot2_target.py b/catalyst/targets/netboot2_target.py index 987afd8..130e2b6 100644 --- a/catalyst/targets/netboot2_target.py +++ b/catalyst/targets/netboot2_target.py @@ -167,7 +167,3 @@ class netboot2_target(StageBase): "setup_environment","build_packages","root_overlay",\ "copy_files_to_image","setup_overlay","build_kernel","move_kernels",\ "remove","empty","unbind","clean","clear_autoresume"] - -def register(foo): - foo.update({"netboot2":netboot2_target}) - return foo diff --git a/catalyst/targets/netboot_target.py b/catalyst/targets/netboot_target.py index c880289..9d92ef2 100644 --- a/catalyst/targets/netboot_target.py +++ b/catalyst/targets/netboot_target.py @@ -127,7 +127,3 @@ class netboot_target(StageBase): "setup_environment","build_packages","build_busybox",\ "build_kernel","copy_files_to_image",\ "clean","create_netboot_files","unbind","clear_autoresume"] - -def register(foo): - foo.update({"netboot":netboot_target}) - return foo diff --git a/catalyst/targets/snapshot_target.py b/catalyst/targets/snapshot.py similarity index 95% rename from catalyst/targets/snapshot_target.py rename to catalyst/targets/snapshot.py index 337ff1d..6c2396e 100644 --- a/catalyst/targets/snapshot_target.py +++ b/catalyst/targets/snapshot.py @@ -11,7 +11,7 @@ from catalyst.support import normpath, cmd from catalyst.base.targetbase import TargetBase from catalyst.base.genbase import GenBase -class snapshot_target(TargetBase, GenBase): +class snapshot(TargetBase, GenBase): """ Builder class for snapshots. """ @@ -91,7 +91,3 @@ class snapshot_target(TargetBase, GenBase): os.makedirs(myemp,0755) os.chown(myemp,mystat[ST_UID],mystat[ST_GID]) os.chmod(myemp,mystat[ST_MODE]) - -def register(foo): - foo.update({"snapshot":snapshot_target}) - return foo diff --git a/catalyst/targets/stage1_target.py b/catalyst/targets/stage1_target.py index 0a36432..2329b58 100644 --- a/catalyst/targets/stage1_target.py +++ b/catalyst/targets/stage1_target.py @@ -94,7 +94,3 @@ class stage1_target(StageBase): self.mounts.append("stage1root/proc") self.target_mounts["stage1root/proc"] = "/tmp/stage1root/proc" self.mountmap["stage1root/proc"] = "/proc" - -def register(foo): - foo.update({"stage1":stage1_target}) - return foo diff --git a/catalyst/targets/stage2_target.py b/catalyst/targets/stage2_target.py index 783d42e..ec6d78d 100644 --- a/catalyst/targets/stage2_target.py +++ b/catalyst/targets/stage2_target.py @@ -62,7 +62,3 @@ class stage2_target(StageBase): print "\tUsing an portage overlay for earlier stages could cause build issues." print "\tIf you break it, you buy it. Don't complain to us about it." print "\tDont say we did not warn you\n" - -def register(foo): - foo.update({"stage2":stage2_target}) - return foo diff --git a/catalyst/targets/stage3_target.py b/catalyst/targets/stage3_target.py index 28021b1..103242d 100644 --- a/catalyst/targets/stage3_target.py +++ b/catalyst/targets/stage3_target.py @@ -25,7 +25,3 @@ class stage3_target(StageBase): def set_cleanables(self): StageBase.set_cleanables(self) - -def register(foo): - foo.update({"stage3":stage3_target}) - return foo diff --git a/catalyst/targets/stage4_target.py b/catalyst/targets/stage4_target.py index 0d725c7..4dbdb45 100644 --- a/catalyst/targets/stage4_target.py +++ b/catalyst/targets/stage4_target.py @@ -36,8 +36,3 @@ class stage4_target(StageBase): if "fetch" not in self.settings['options']: self.settings["action_sequence"].append("capture") self.settings["action_sequence"].append("clear_autoresume") - -def register(foo): - foo.update({"stage4":stage4_target}) - return foo - diff --git a/catalyst/targets/tinderbox_target.py b/catalyst/targets/tinderbox_target.py index 1e245f2..0c389e6 100644 --- a/catalyst/targets/tinderbox_target.py +++ b/catalyst/targets/tinderbox_target.py @@ -45,7 +45,3 @@ class tinderbox_target(StageBase): "config_profile_link","setup_confdir","bind","chroot_setup",\ "setup_environment","run_local","preclean","unbind","clean",\ "clear_autoresume"] - -def register(foo): - foo.update({"tinderbox":tinderbox_target}) - return foo