Do a mass sed to fix up all remaining usage of has_key()
authorAndrew Gaffney <agaffney@gentoo.org>
Sun, 11 Jan 2009 06:01:44 +0000 (00:01 -0600)
committerAndrew Gaffney <agaffney@gentoo.org>
Sun, 11 Jan 2009 06:01:44 +0000 (00:01 -0600)
16 files changed:
ChangeLog
modules/catalyst/config.py
modules/catalyst/lock.py
modules/catalyst/support.py
modules/catalyst/target/embedded.py
modules/catalyst/target/generic_stage.py
modules/catalyst/target/grp.py
modules/catalyst/target/livecd_stage1.py
modules/catalyst/target/livecd_stage2.py
modules/catalyst/target/netboot.py
modules/catalyst/target/netboot2.py
modules/catalyst/target/snapshot.py
modules/catalyst/target/stage1.py
modules/catalyst/target/stage2.py
modules/catalyst/target/stage3.py
modules/catalyst/target/stage4.py

index 1970e37c5d2459e56b69359ff36e14d69dca5e0a..890fdcdff1d57e226a36b586b3b3ee635ce80fea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
 # Copyright 2002-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS)
 # Distributed under the GPL v2
 
+  11 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
+  modules/catalyst/config.py, modules/catalyst/lock.py,
+  modules/catalyst/support.py, modules/catalyst/target/embedded.py,
+  modules/catalyst/target/generic_stage.py, modules/catalyst/target/grp.py,
+  modules/catalyst/target/livecd_stage1.py,
+  modules/catalyst/target/livecd_stage2.py,
+  modules/catalyst/target/netboot.py, modules/catalyst/target/netboot2.py,
+  modules/catalyst/target/snapshot.py, modules/catalyst/target/stage1.py,
+  modules/catalyst/target/stage2.py, modules/catalyst/target/stage3.py,
+  modules/catalyst/target/stage4.py:
+  Do a mass sed to fix up all remaining usage of has_key()
+
   11 Jan 2009; Andrew Gaffney <agaffney@gentoo.org> catalyst:
   Clean up instances of has_key() for py3k
 
index 9315c6798669c1b423818616b3ac25f274909566..f4c351d74e170876e72b678da73a6d51aebe3d3b 100644 (file)
@@ -62,7 +62,7 @@ class ParserBase:
                                mobjs[1] = mobjs[1].strip().strip('"')
 
 #                              # Check that this key doesn't exist already in the spec
-#                              if values.has_key(mobjs[0]):
+#                              if mobjs[0] in values:
 #                                      raise Exception("You have a duplicate key (" + mobjs[0] + ") in your spec. Please fix it")
 
                                # Start a new array using the first element of mobjs
index 37208821631d6e7d19bdfd3855f13ad66d0b77bc..14bf378f53ae835d21af3c1604a8d950e6cad856 100644 (file)
@@ -58,7 +58,7 @@ class LockDir:
 
        def set_gid(self,gid):
                if not self.islocked():
-#                      if self.settings.has_key("DEBUG"):
+#                      if "DEBUG" in self.settings:
 #                              print "setting gid to", gid 
                        self.gid=gid
 
@@ -70,7 +70,7 @@ class LockDir:
                                if lockdir[-1] == "/":
                                        lockdir=lockdir[:-1]
                                self.lockdir=normpath(lockdir)
-#                              if self.settings.has_key("DEBUG"):
+#                              if "DEBUG" in self.settings:
 #                                      print "setting lockdir to", self.lockdir
                else:
                        raise "the lock object needs a path to a dir"
@@ -78,13 +78,13 @@ class LockDir:
        def set_lockfilename(self,lockfilename):
                if not self.islocked():
                        self.lockfilename=lockfilename
-#                      if self.settings.has_key("DEBUG"):
+#                      if "DEBUG" in self.settings:
 #                              print "setting lockfilename to", self.lockfilename
 
        def set_lockfile(self):
                if not self.islocked():
                        self.lockfile=normpath(self.lockdir+'/'+self.lockfilename)
-#                      if self.settings.has_key("DEBUG"):
+#                      if "DEBUG" in self.settings:
 #                              print "setting lockfile to", self.lockfile
 
        def read_lock(self):
@@ -210,7 +210,7 @@ class LockDir:
                                                os.unlink(self.lockfile)
                                                os.close(self.myfd)
                                                self.myfd=None
-#                                              if self.settings.has_key("DEBUG"):
+#                                              if "DEBUG" in self.settings:
 #                                                      print "Unlinked lockfile..."
                                except SystemExit, e:
                                        raise
@@ -259,7 +259,7 @@ class LockDir:
                        except SystemExit, e:
                                raise
                        except Exception, e:
-#                              if self.settings.has_key("DEBUG"):
+#                              if "DEBUG" in self.settings:
 #                                      print "lockfile(): Hardlink: Link failed."
 #                                      print "Exception: ",e
                                pass
@@ -299,7 +299,7 @@ class LockDir:
                        self.hardlock_paths[self.lockdir]=self.myhardlock
     
        def remove_hardlock_file_from_cleanup(self):
-               if self.hardlock_paths.has_key(self.lockdir):
+               if self.lockdir in self.hardlock_paths:
                        del self.hardlock_paths[self.lockdir]
                        print self.hardlock_paths
 
@@ -359,10 +359,10 @@ class LockDir:
                                hostpid  = parts[1].split("-")
                                host  = "-".join(hostpid[:-1])
                                pid   = hostpid[-1]
-                       if not mylist.has_key(filename):
+                       if not filename in mylist:
                                mylist[filename] = {}
                            
-                       if not mylist[filename].has_key(host):
+                       if not host in mylist[filename]:
                                mylist[filename][host] = []
                                mylist[filename][host].append(pid)
                                mycount += 1
@@ -373,7 +373,7 @@ class LockDir:
 
                results.append("Found %(count)s locks" % {"count":mycount})
                for x in mylist.keys():
-                       if mylist[x].has_key(myhost):
+                       if myhost in mylist[x]:
                                mylockname = self.hardlock_name(x)
                                if self.hardlink_is_mine(mylockname, self.lockfile) or \
                                        not os.path.exists(self.lockfile):
index 5f51d6cac1bbfb3afa3254d19d82d404d84ced75..564c67b8e301664afc6ef143a94fcc56e24cd52a 100644 (file)
@@ -289,7 +289,7 @@ def spawn_bash(mycommand,env={},debug=False,opt_name=None,**keywords):
        args=[BASH_BINARY]
        if not opt_name:
            opt_name=mycommand.split()[0]
-       if not env.has_key("BASH_ENV"):
+       if not "BASH_ENV" in env:
            env["BASH_ENV"] = "/etc/spork/is/not/valid/profile.env"
        if debug:
            args.append("-x")
@@ -554,7 +554,7 @@ def file_locate(settings,filelist,expand=1):
        #if expand=1, non-absolute paths will be accepted and
        # expanded to os.getcwd()+"/"+localpath if file exists
        for myfile in filelist:
-               if not settings.has_key(myfile):
+               if not myfile in settings:
                        #filenames such as cdtar are optional, so we don't assume the variable is defined.
                        pass
                else:
@@ -671,7 +671,7 @@ def addl_arg_parse(myspec,addlargs,requiredspec,validspec):
                        myspec[x]=addlargs[x]
        
        for x in requiredspec:
-               if not myspec.has_key(x):
+               if not x in myspec:
                        raise CatalystError, "Required argument \""+x+"\" not specified."
        
 def touch(myfile):
index c0d3464e3e969d695bfcc85a64a878a2efcc5a2d..ed15b5ada06351d1964ff5f359050b1bac18b425 100644 (file)
@@ -21,7 +21,7 @@ class embedded_target(generic_stage_target):
                self.valid_values=[]
                self.valid_values.extend(["embedded/empty","embedded/rm","embedded/unmerge","embedded/fs-prepare","embedded/fs-finish","embedded/mergeroot","embedded/packages","embedded/fs-type","embedded/runscript","boot/kernel","embedded/linuxrc"])
                self.valid_values.extend(["embedded/use"])
-               if addlargs.has_key("embedded/fs-type"):
+               if "embedded/fs-type" in addlargs:
                        self.valid_values.append("embedded/fs-ops")
 
                generic_stage_target.__init__(self,spec,addlargs)
index 1a8cdbf32cbcfea19d89b41b0ff9c3b607d7e1bc..21e1285ec0474820d678b6eca1f3440252ec87ee 100644 (file)
@@ -61,21 +61,21 @@ class generic_stage_target(generic_target):
                        for subarch in arch_modules[x].__subarch_map:
                                machinemap[subarch] = arch_modules[x]
 
-               if self.settings.has_key("chost"):
+               if "chost" in self.settings:
                        hostmachine = self.settings["chost"].split("-")[0]
-                       if not machinemap.has_key(hostmachine):
+                       if not hostmachine in machinemap:
                                raise CatalystError, "Unknown host machine type "+hostmachine
                        self.settings["hostarch"]=machinemap[hostmachine]
                else:
                        hostmachine = self.settings["subarch"]
-                       if machinemap.has_key(hostmachine):
+                       if hostmachine in machinemap:
                                hostmachine = machinemap[hostmachine]
                        self.settings["hostarch"]=hostmachine
-               if self.settings.has_key("cbuild"):
+               if "cbuild" in self.settings:
                        buildmachine = self.settings["cbuild"].split("-")[0]
                else:
                        buildmachine = os.uname()[4]
-               if not machinemap.has_key(buildmachine):
+               if not buildmachine in machinemap:
                        raise CatalystError, "Unknown build machine type "+buildmachine
                self.settings["buildarch"]=machinemap[buildmachine]
                self.settings["crosscompile"]=(self.settings["hostarch"]!=\
@@ -152,11 +152,11 @@ class generic_stage_target(generic_target):
                file_locate(self.settings,["source_path","snapshot_path","distdir"],\
                        expand=0)
                """ If we are using portage_confdir, check that as well. """
-               if self.settings.has_key("portage_confdir"):
+               if "portage_confdir" in self.settings:
                        file_locate(self.settings,["portage_confdir"],expand=0)
 
                """ Setup our mount points """
-               if self.settings.has_key("SNAPCACHE"):
+               if "SNAPCACHE" in self.settings:
                        self.mounts=["/proc","/dev","/usr/portage","/usr/portage/distfiles"]
                        self.mountmap={"/proc":"/proc","/dev":"/dev","/dev/pts":"/dev/pts",\
                                "/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
@@ -174,7 +174,7 @@ class generic_stage_target(generic_target):
                Configure any user specified options (either in catalyst.conf or on
                the command line).
                """
-               if self.settings.has_key("PKGCACHE"):
+               if "PKGCACHE" in self.settings:
                        self.set_pkgcache_path()
                        print "Location of the package cache is "+\
                                self.settings["pkgcache_path"]
@@ -182,15 +182,15 @@ class generic_stage_target(generic_target):
                        self.mountmap["/usr/portage/packages"]=\
                                self.settings["pkgcache_path"]
 
-               if self.settings.has_key("KERNCACHE"):
+               if "KERNCACHE" in self.settings:
                        self.set_kerncache_path()
                        print "Location of the kerncache is "+\
                                self.settings["kerncache_path"]
                        self.mounts.append("/tmp/kerncache")
                        self.mountmap["/tmp/kerncache"]=self.settings["kerncache_path"]
 
-               if self.settings.has_key("CCACHE"):
-                       if os.environ.has_key("CCACHE_DIR"):
+               if "CCACHE" in self.settings:
+                       if "CCACHE_DIR" in os.environ:
                                ccdir=os.environ["CCACHE_DIR"]
                                del os.environ["CCACHE_DIR"]
                        else:
@@ -204,33 +204,33 @@ class generic_stage_target(generic_target):
                        """ for the chroot: """
                        self.env["CCACHE_DIR"]="/var/tmp/ccache"
 
-               if self.settings.has_key("ICECREAM"):
+               if "ICECREAM" in self.settings:
                        self.mounts.append("/var/cache/icecream")
                        self.mountmap["/var/cache/icecream"]="/var/cache/icecream"
                        self.env["PATH"]="/usr/lib/icecc/bin:"+self.env["PATH"]
 
        def override_cbuild(self):
-               if self.makeconf.has_key("CBUILD"):
+               if "CBUILD" in self.makeconf:
                        self.settings["CBUILD"]=self.makeconf["CBUILD"]
 
        def override_chost(self):
-               if self.makeconf.has_key("CHOST"):
+               if "CHOST" in self.makeconf:
                        self.settings["CHOST"]=self.makeconf["CHOST"]
 
        def override_cflags(self):
-               if self.makeconf.has_key("CFLAGS"):
+               if "CFLAGS" in self.makeconf:
                        self.settings["CFLAGS"]=self.makeconf["CFLAGS"]
 
        def override_cxxflags(self):
-               if self.makeconf.has_key("CXXFLAGS"):
+               if "CXXFLAGS" in self.makeconf:
                        self.settings["CXXFLAGS"]=self.makeconf["CXXFLAGS"]
 
        def override_ldflags(self):
-               if self.makeconf.has_key("LDFLAGS"):
+               if "LDFLAGS" in self.makeconf:
                        self.settings["LDFLAGS"]=self.makeconf["LDFLAGS"]
 
        def set_install_mask(self):
-               if self.settings.has_key("install_mask"):
+               if "install_mask" in self.settings:
                        if type(self.settings["install_mask"])!=types.StringType:
                                self.settings["install_mask"]=\
                                        string.join(self.settings["install_mask"])
@@ -252,7 +252,7 @@ class generic_stage_target(generic_target):
                                "source_subpath should have been a string. Perhaps you have something wrong in your spec file?"
 
        def set_pkgcache_path(self):
-               if self.settings.has_key("pkgcache_path"):
+               if "pkgcache_path" in self.settings:
                        if type(self.settings["pkgcache_path"])!=types.StringType:
                                self.settings["pkgcache_path"]=\
                                        normpath(string.join(self.settings["pkgcache_path"]))
@@ -262,7 +262,7 @@ class generic_stage_target(generic_target):
                                self.settings["target_subpath"]+"/")
 
        def set_kerncache_path(self):
-               if self.settings.has_key("kerncache_path"):
+               if "kerncache_path" in self.settings:
                        if type(self.settings["kerncache_path"])!=types.StringType:
                                self.settings["kerncache_path"]=\
                                        normpath(string.join(self.settings["kerncache_path"]))
@@ -273,7 +273,7 @@ class generic_stage_target(generic_target):
        def set_target_path(self):
                self.settings["target_path"]=normpath(self.settings["storedir"]+\
                        "/builds/"+self.settings["target_subpath"]+".tar.bz2")
-               if self.settings.has_key("AUTORESUME")\
+               if "AUTORESUME" in self.settings\
                        and os.path.exists(self.settings["autoresume_path"]+\
                                "setup_target_path"):
                        print \
@@ -293,31 +293,31 @@ class generic_stage_target(generic_target):
                                os.makedirs(self.settings["storedir"]+"/builds/")
 
        def set_fsscript(self):
-               if self.settings.has_key(self.settings["spec_prefix"]+"/fsscript"):
+               if self.settings["spec_prefix"]+"/fsscript" in self.settings:
                        self.settings["fsscript"]=\
                                self.settings[self.settings["spec_prefix"]+"/fsscript"]
                        del self.settings[self.settings["spec_prefix"]+"/fsscript"]
 
        def set_rcadd(self):
-               if self.settings.has_key(self.settings["spec_prefix"]+"/rcadd"):
+               if self.settings["spec_prefix"]+"/rcadd" in self.settings:
                        self.settings["rcadd"]=\
                                self.settings[self.settings["spec_prefix"]+"/rcadd"]
                        del self.settings[self.settings["spec_prefix"]+"/rcadd"]
 
        def set_rcdel(self):
-               if self.settings.has_key(self.settings["spec_prefix"]+"/rcdel"):
+               if self.settings["spec_prefix"]+"/rcdel" in self.settings:
                        self.settings["rcdel"]=\
                                self.settings[self.settings["spec_prefix"]+"/rcdel"]
                        del self.settings[self.settings["spec_prefix"]+"/rcdel"]
 
        def set_cdtar(self):
-               if self.settings.has_key(self.settings["spec_prefix"]+"/cdtar"):
+               if self.settings["spec_prefix"]+"/cdtar" in self.settings:
                        self.settings["cdtar"]=\
                                normpath(self.settings[self.settings["spec_prefix"]+"/cdtar"])
                        del self.settings[self.settings["spec_prefix"]+"/cdtar"]
 
        def set_iso(self):
-               if self.settings.has_key(self.settings["spec_prefix"]+"/iso"):
+               if self.settings["spec_prefix"]+"/iso" in self.settings:
                        if self.settings[self.settings["spec_prefix"]+"/iso"].startswith('/'):
                                self.settings["iso"]=\
                                        normpath(self.settings[self.settings["spec_prefix"]+"/iso"])
@@ -330,12 +330,12 @@ class generic_stage_target(generic_target):
                        del self.settings[self.settings["spec_prefix"]+"/iso"]
 
        def set_fstype(self):
-               if self.settings.has_key(self.settings["spec_prefix"]+"/fstype"):
+               if self.settings["spec_prefix"]+"/fstype" in self.settings:
                        self.settings["fstype"]=\
                                self.settings[self.settings["spec_prefix"]+"/fstype"]
                        del self.settings[self.settings["spec_prefix"]+"/fstype"]
 
-               if not self.settings.has_key("fstype"):
+               if not "fstype" in self.settings:
                        self.settings["fstype"]="normal"
                        for x in self.valid_values:
                                if x ==  self.settings["spec_prefix"]+"/fstype":
@@ -343,15 +343,15 @@ class generic_stage_target(generic_target):
                                                "/fstype is being set to the default of \"normal\"\n"
 
        def set_fsops(self):
-               if self.settings.has_key("fstype"):
+               if "fstype" in self.settings:
                        self.valid_values.append("fsops")
-                       if self.settings.has_key(self.settings["spec_prefix"]+"/fsops"):
+                       if self.settings["spec_prefix"]+"/fsops" in self.settings:
                                self.settings["fsops"]=\
                                        self.settings[self.settings["spec_prefix"]+"/fsops"]
                                del self.settings[self.settings["spec_prefix"]+"/fsops"]
 
        def set_source_path(self):
-               if self.settings.has_key("SEEDCACHE")\
+               if "SEEDCACHE" in self.settings\
                        and os.path.isdir(normpath(self.settings["storedir"]+"/tmp/"+\
                                self.settings["source_subpath"]+"/")):
                        self.settings["source_path"]=normpath(self.settings["storedir"]+\
@@ -375,7 +375,7 @@ class generic_stage_target(generic_target):
                                self.settings["source_subpath"]+".tar.bz2\n")
 
        def set_dest_path(self):
-               if self.settings.has_key("root_path"):
+               if "root_path" in self.settings:
                        self.settings["destpath"]=normpath(self.settings["chroot_path"]+\
                                self.settings["root_path"])
                else:
@@ -395,7 +395,7 @@ class generic_stage_target(generic_target):
                                hash_function=self.settings["hash_function"],verbose=False)
 
        def set_snapcache_path(self):
-               if self.settings.has_key("SNAPCACHE"):
+               if "SNAPCACHE" in self.settings:
                        self.settings["snapshot_cache_path"]=\
                                normpath(self.settings["snapshot_cache"]+"/"+\
                                self.settings["snapshot"]+"/")
@@ -417,7 +417,7 @@ class generic_stage_target(generic_target):
                        "/tmp/"+self.settings["rel_type"]+"/"+".autoresume-"+\
                        self.settings["target"]+"-"+self.settings["subarch"]+"-"+\
                        self.settings["version_stamp"]+"/")
-               if self.settings.has_key("AUTORESUME"):
+               if "AUTORESUME" in self.settings:
                        print "The autoresume path is " + self.settings["autoresume_path"]
                if not os.path.exists(self.settings["autoresume_path"]):
                        os.makedirs(self.settings["autoresume_path"],0755)
@@ -428,7 +428,7 @@ class generic_stage_target(generic_target):
                        "-controller.sh")
 
        def set_iso_volume_id(self):
-               if self.settings.has_key(self.settings["spec_prefix"]+"/volid"):
+               if self.settings["spec_prefix"]+"/volid" in self.settings:
                        self.settings["iso_volume_id"]=\
                                self.settings[self.settings["spec_prefix"]+"/volid"]
                        if len(self.settings["iso_volume_id"])>32:
@@ -443,18 +443,18 @@ class generic_stage_target(generic_target):
                                "config_profile_link","setup_confdir","portage_overlay",\
                                "base_dirs","bind","chroot_setup","setup_environment",\
                                "run_local","preclean","unbind","clean"]
-#              if self.settings.has_key("TARBALL") or \
-#                      not self.settings.has_key("FETCH"):
-               if not self.settings.has_key("FETCH"):
+#              if "TARBALL" in self.settings or \
+#                      not "FETCH" in self.settings:
+               if not "FETCH" in self.settings:
                        self.settings["action_sequence"].append("capture")
                self.settings["action_sequence"].append("clear_autoresume")
 
        def set_use(self):
-               if self.settings.has_key(self.settings["spec_prefix"]+"/use"):
+               if self.settings["spec_prefix"]+"/use" in self.settings:
                        self.settings["use"]=\
                                self.settings[self.settings["spec_prefix"]+"/use"]
                        del self.settings[self.settings["spec_prefix"]+"/use"]
-               if self.settings.has_key("use"):
+               if "use" in self.settings:
                        if type(self.settings["use"])==types.StringType:
                                self.settings["use"]=self.settings["use"].split()
                                self.settings["use"].append("bindist")
@@ -469,14 +469,14 @@ class generic_stage_target(generic_target):
                pass
 
        def set_rm(self):
-               if self.settings.has_key(self.settings["spec_prefix"]+"/rm"):
+               if self.settings["spec_prefix"]+"/rm" in self.settings:
                        if type(self.settings[self.settings["spec_prefix"]+\
                                "/rm"])==types.StringType:
                                self.settings[self.settings["spec_prefix"]+"/rm"]=\
                                        self.settings[self.settings["spec_prefix"]+"/rm"].split()
 
        def set_linuxrc(self):
-               if self.settings.has_key(self.settings["spec_prefix"]+"/linuxrc"):
+               if self.settings["spec_prefix"]+"/linuxrc" in self.settings:
                        if type(self.settings[self.settings["spec_prefix"]+\
                                "/linuxrc"])==types.StringType:
                                self.settings["linuxrc"]=\
@@ -484,7 +484,7 @@ class generic_stage_target(generic_target):
                                del self.settings[self.settings["spec_prefix"]+"/linuxrc"]
 
        def set_busybox_config(self):
-               if self.settings.has_key(self.settings["spec_prefix"]+"/busybox_config"):
+               if self.settings["spec_prefix"]+"/busybox_config" in self.settings:
                        if type(self.settings[self.settings["spec_prefix"]+\
                                "/busybox_config"])==types.StringType:
                                self.settings["busybox_config"]=\
@@ -492,7 +492,7 @@ class generic_stage_target(generic_target):
                                del self.settings[self.settings["spec_prefix"]+"/busybox_config"]
 
        def set_portage_overlay(self):
-               if self.settings.has_key("portage_overlay"):
+               if "portage_overlay" in self.settings:
                        if type(self.settings["portage_overlay"])==types.StringType:
                                self.settings["portage_overlay"]=\
                                        self.settings["portage_overlay"].split()
@@ -500,7 +500,7 @@ class generic_stage_target(generic_target):
                                string.join(self.settings["portage_overlay"])+"\""
 
        def set_overlay(self):
-               if self.settings.has_key(self.settings["spec_prefix"]+"/overlay"):
+               if self.settings["spec_prefix"]+"/overlay" in self.settings:
                        if type(self.settings[self.settings["spec_prefix"]+\
                                "/overlay"])==types.StringType:
                                self.settings[self.settings["spec_prefix"]+"/overlay"]=\
@@ -508,7 +508,7 @@ class generic_stage_target(generic_target):
                                        "/overlay"].split()
 
        def set_root_overlay(self):
-               if self.settings.has_key(self.settings["spec_prefix"]+"/root_overlay"):
+               if self.settings["spec_prefix"]+"/root_overlay" in self.settings:
                        if type(self.settings[self.settings["spec_prefix"]+\
                                "/root_overlay"])==types.StringType:
                                self.settings[self.settings["spec_prefix"]+"/root_overlay"]=\
@@ -520,7 +520,7 @@ class generic_stage_target(generic_target):
                self.settings["root_path"]="/"
 
        def set_valid_build_kernel_vars(self,addlargs):
-               if addlargs.has_key("boot/kernel"):
+               if "boot/kernel" in addlargs:
                        if type(addlargs["boot/kernel"])==types.StringType:
                                loopy=[addlargs["boot/kernel"]]
                        else:
@@ -539,14 +539,14 @@ class generic_stage_target(generic_target):
                                self.valid_values.append("boot/kernel/"+x+"/softlevel")
                                self.valid_values.append("boot/kernel/"+x+"/use")
                                self.valid_values.append("boot/kernel/"+x+"/packages")
-                               if addlargs.has_key("boot/kernel/"+x+"/packages"):
+                               if "boot/kernel/"+x+"/packages" in addlargs:
                                        if type(addlargs["boot/kernel/"+x+\
                                                "/packages"])==types.StringType:
                                                addlargs["boot/kernel/"+x+"/packages"]=\
                                                        [addlargs["boot/kernel/"+x+"/packages"]]
 
        def set_build_kernel_vars(self):
-               if self.settings.has_key(self.settings["spec_prefix"]+"/gk_mainargs"):
+               if self.settings["spec_prefix"]+"/gk_mainargs" in self.settings:
                        self.settings["gk_mainargs"]=\
                                self.settings[self.settings["spec_prefix"]+"/gk_mainargs"]
                        del self.settings[self.settings["spec_prefix"]+"/gk_mainargs"]
@@ -600,7 +600,7 @@ class generic_stage_target(generic_target):
                clst_unpack_hash=read_from_clst(self.settings["autoresume_path"]+\
                        "unpack")
 
-               if self.settings.has_key("SEEDCACHE"):
+               if "SEEDCACHE" in self.settings:
                        if os.path.isdir(self.settings["source_path"]): 
                                """ SEEDCACHE Is a directory, use rsync """
                                unpack_cmd="rsync -a --delete "+self.settings["source_path"]+\
@@ -634,7 +634,7 @@ class generic_stage_target(generic_target):
                        error_msg="Tarball extraction of "+self.settings["source_path"]+\
                                " to "+self.settings["chroot_path"]+" failed."
 
-               if self.settings.has_key("AUTORESUME"):
+               if "AUTORESUME" in self.settings:
                        if os.path.isdir(self.settings["source_path"]) \
                                and os.path.exists(self.settings["autoresume_path"]+"unpack"):
                                """ Autoresume is valid, SEEDCACHE is valid """
@@ -661,7 +661,7 @@ class generic_stage_target(generic_target):
                                invalid_snapshot=True
                else:
                        """ No autoresume, SEEDCACHE """
-                       if self.settings.has_key("SEEDCACHE"):
+                       if "SEEDCACHE" in self.settings:
                                """ SEEDCACHE so let's run rsync and let it clean up """
                                if os.path.isdir(self.settings["source_path"]):
                                        unpack=True
@@ -685,7 +685,7 @@ class generic_stage_target(generic_target):
                        self.mount_safety_check()
 
                        if invalid_snapshot:
-                               if self.settings.has_key("AUTORESUME"):
+                               if "AUTORESUME" in self.settings:
                                        print "No Valid Resume point detected, cleaning up..."
 
                                self.clear_autoresume()
@@ -697,18 +697,18 @@ class generic_stage_target(generic_target):
                        if not os.path.exists(self.settings["chroot_path"]+"/tmp"):
                                os.makedirs(self.settings["chroot_path"]+"/tmp",1777)
 
-                       if self.settings.has_key("PKGCACHE"):
+                       if "PKGCACHE" in self.settings:
                                if not os.path.exists(self.settings["pkgcache_path"]):
                                        os.makedirs(self.settings["pkgcache_path"],0755)
 
-                       if self.settings.has_key("KERNCACHE"):
+                       if "KERNCACHE" in self.settings:
                                if not os.path.exists(self.settings["kerncache_path"]):
                                        os.makedirs(self.settings["kerncache_path"],0755)
 
                        print display_msg
                        cmd(unpack_cmd,error_msg,env=self.env)
 
-                       if self.settings.has_key("source_path_hash"):
+                       if "source_path_hash" in self.settings:
                                myf=open(self.settings["autoresume_path"]+"unpack","w")
                                myf.write(self.settings["source_path_hash"])
                                myf.close()
@@ -722,7 +722,7 @@ class generic_stage_target(generic_target):
                snapshot_hash=read_from_clst(self.settings["autoresume_path"]+\
                        "unpack_portage")
 
-               if self.settings.has_key("SNAPCACHE")
+               if "SNAPCACHE" in self.settings
                        snapshot_cache_hash=\
                                read_from_clst(self.settings["snapshot_cache_path"]+\
                                "catalyst-hash")
@@ -747,7 +747,7 @@ class generic_stage_target(generic_target):
                                self.settings["chroot_path"]+"/usr"
                        unpack_errmsg="Error unpacking snapshot"
 
-                       if self.settings.has_key("AUTORESUME") \
+                       if "AUTORESUME" in self.settings \
                                and os.path.exists(self.settings["chroot_path"]+\
                                        "/usr/portage/") \
                                and os.path.exists(self.settings["autoresume_path"]\
@@ -758,7 +758,7 @@ class generic_stage_target(generic_target):
                                        unpack=False
 
                if unpack:
-                       if self.settings.has_key("SNAPCACHE")
+                       if "SNAPCACHE" in self.settings
                                self.snapshot_lock_object.write_lock()
                        if os.path.exists(destdir):
                                print cleanup_msg
@@ -770,7 +770,7 @@ class generic_stage_target(generic_target):
                        print "Unpacking portage tree (This can take a long time) ..."
                        cmd(unpack_cmd,unpack_errmsg,env=self.env)
 
-                       if self.settings.has_key("SNAPCACHE")
+                       if "SNAPCACHE" in self.settings
                                myf=open(self.settings["snapshot_cache_path"]+"catalyst-hash","w")
                                myf.write(self.settings["snapshot_path_hash"])
                                myf.close()
@@ -780,11 +780,11 @@ class generic_stage_target(generic_target):
                                myf.write(self.settings["snapshot_path_hash"])
                                myf.close()
 
-                       if self.settings.has_key("SNAPCACHE")
+                       if "SNAPCACHE" in self.settings
                                self.snapshot_lock_object.unlock()
 
        def config_profile_link(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+\
                                "config_profile_link"):
                        print \
@@ -802,12 +802,12 @@ class generic_stage_target(generic_target):
                        touch(self.settings["autoresume_path"]+"config_profile_link")
 
        def setup_confdir(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+\
                                "setup_confdir"):
                        print "Resume point detected, skipping setup_confdir operation..."
                else:
-                       if self.settings.has_key("portage_confdir"):
+                       if "portage_confdir" in self.settings:
                                print "Configuring /etc/portage..."
                                cmd("rm -rf "+self.settings["chroot_path"]+"/etc/portage",\
                                        "Error zapping /etc/portage",env=self.env)
@@ -818,7 +818,7 @@ class generic_stage_target(generic_target):
 
        def portage_overlay(self):
                """ We copy the contents of our overlays to /usr/local/portage """
-               if self.settings.has_key("portage_overlay"):
+               if "portage_overlay" in self.settings:
                        for x in self.settings["portage_overlay"]: 
                                if os.path.exists(x):
                                        print "Copying overlay dir " +x
@@ -831,7 +831,7 @@ class generic_stage_target(generic_target):
 
        def root_overlay(self):
                """ Copy over the root_overlay """
-               if self.settings.has_key(self.settings["spec_prefix"]+"/root_overlay"):
+               if self.settings["spec_prefix"]+"/root_overlay" in self.settings:
                        for x in self.settings[self.settings["spec_prefix"]+\
                                "/root_overlay"]: 
                                if os.path.exists(x):
@@ -853,7 +853,7 @@ class generic_stage_target(generic_target):
                                os.makedirs(self.mountmap[x],0755)
 
                        src=self.mountmap[x]
-                       if self.settings.has_key("SNAPCACHE") and x == "/usr/portage":
+                       if "SNAPCACHE" in self.settings and x == "/usr/portage":
                                self.snapshot_lock_object.read_lock()
                        if os.uname()[0] == "FreeBSD":
                                if src == "/dev":
@@ -896,7 +896,7 @@ class generic_stage_target(generic_target):
                                        ouch=1
                                        warn("Couldn't umount bind mount: "+mypath+x)
 
-                       if self.settings.has_key("SNAPCACHE") and x == "/usr/portage":
+                       if "SNAPCACHE" in self.settings and x == "/usr/portage":
                                try:
                                        """
                                        It's possible the snapshot lock object isn't created yet.
@@ -923,7 +923,7 @@ class generic_stage_target(generic_target):
                self.override_cflags()
                self.override_cxxflags()        
                self.override_ldflags() 
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"chroot_setup"):
                        print "Resume point detected, skipping chroot_setup operation..."
                else:
@@ -935,7 +935,7 @@ class generic_stage_target(generic_target):
                                "Could not copy resolv.conf into place.",env=self.env)
                
                        """ Copy over the envscript, if applicable """
-                       if self.settings.has_key("ENVSCRIPT"):
+                       if "ENVSCRIPT" in self.settings:
                                if not os.path.exists(self.settings["ENVSCRIPT"]):
                                        raise CatalystError,\
                                                "Can't find envscript "+self.settings["ENVSCRIPT"]
@@ -953,8 +953,8 @@ class generic_stage_target(generic_target):
                                        "Could not copy envscript into place.",env=self.env)
 
                        """ Setup metadata_overlay """
-                       if self.settings.has_key("METADATA_OVERLAY") \
-                               and not self.settings.has_key("portage_confdir"):
+                       if "METADATA_OVERLAY" in self.settings \
+                               and not "portage_confdir" in self.settings:
                                if not os.path.exists(self.settings["chroot_path"]+\
                                        "/etc/portage"):
                                        cmd("mkdir "+self.settings["chroot_path"]+"/etc/portage")
@@ -982,17 +982,17 @@ class generic_stage_target(generic_target):
                        myf=open(self.settings["chroot_path"]+"/etc/make.conf","w")
                        myf.write("# These settings were set by the catalyst build script that automatically\n# built this stage.\n")
                        myf.write("# Please consult /etc/make.conf.example for a more detailed example.\n")
-                       if self.settings.has_key("CFLAGS"):
+                       if "CFLAGS" in self.settings:
                                myf.write('CFLAGS="'+self.settings["CFLAGS"]+'"\n')
-                       if self.settings.has_key("CXXFLAGS"):
+                       if "CXXFLAGS" in self.settings:
                                myf.write('CXXFLAGS="'+self.settings["CXXFLAGS"]+'"\n')
                        else:
                                myf.write('CXXFLAGS="${CFLAGS}"\n')
 
-                       if self.settings.has_key("LDFLAGS"):
+                       if "LDFLAGS" in self.settings:
                                myf.write("# LDFLAGS is unsupported.  USE AT YOUR OWN RISK!\n")
                                myf.write('LDFLAGS="'+self.settings["LDFLAGS"]+'"\n')
-                       if self.settings.has_key("CBUILD"):
+                       if "CBUILD" in self.settings:
                                myf.write("# This should not be changed unless you know exactly what you are doing.  You\n# should probably be using a different stage, instead.\n")
                                myf.write('CBUILD="'+self.settings["CBUILD"]+'"\n')
 
@@ -1001,10 +1001,10 @@ class generic_stage_target(generic_target):
 
                        """ Figure out what our USE vars are for building """
                        myusevars=[]
-                       if self.settings.has_key("HOSTUSE"):
+                       if "HOSTUSE" in self.settings:
                                myusevars.extend(self.settings["HOSTUSE"])
 
-                       if self.settings.has_key("use"):
+                       if "use" in self.settings:
                                myusevars.extend(self.settings["use"])
 
                        if myusevars:
@@ -1018,7 +1018,7 @@ class generic_stage_target(generic_target):
                                        print "\tpackage.use in the profile and portage_confdir. You've been warned!"
 
                        """ Setup the portage overlay """
-                       if self.settings.has_key("portage_overlay"):
+                       if "portage_overlay" in self.settings:
                                myf.write('PORTDIR_OVERLAY="/usr/local/portage"\n')
 
                        myf.close()
@@ -1028,18 +1028,18 @@ class generic_stage_target(generic_target):
                        touch(self.settings["autoresume_path"]+"chroot_setup")
 
        def fsscript(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"fsscript"):
                        print "Resume point detected, skipping fsscript operation..."
                else:
-                       if self.settings.has_key("fsscript"):
+                       if "fsscript" in self.settings:
                                if os.path.exists(self.settings["controller_file"]):
                                        cmd("/bin/bash "+self.settings["controller_file"]+\
                                                " fsscript","fsscript script failed.",env=self.env)
                                        touch(self.settings["autoresume_path"]+"fsscript")
 
        def rcupdate(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"rcupdate"):
                        print "Resume point detected, skipping rcupdate operation..."
                else:
@@ -1049,7 +1049,7 @@ class generic_stage_target(generic_target):
                                touch(self.settings["autoresume_path"]+"rcupdate")
 
        def clean(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"clean"):
                        print "Resume point detected, skipping clean operation..."
                else:
@@ -1084,11 +1084,11 @@ class generic_stage_target(generic_target):
                        touch(self.settings["autoresume_path"]+"clean")
 
        def empty(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"empty"):
                        print "Resume point detected, skipping empty operation..."
                else:
-                       if self.settings.has_key(self.settings["spec_prefix"]+"/empty"):
+                       if self.settings["spec_prefix"]+"/empty" in self.settings:
                                if type(self.settings[self.settings["spec_prefix"]+\
                                        "/empty"])==types.StringType:
                                        self.settings[self.settings["spec_prefix"]+"/empty"]=\
@@ -1112,11 +1112,11 @@ class generic_stage_target(generic_target):
                        touch(self.settings["autoresume_path"]+"empty")
 
        def remove(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"remove"):
                        print "Resume point detected, skipping remove operation..."
                else:
-                       if self.settings.has_key(self.settings["spec_prefix"]+"/rm"):
+                       if self.settings["spec_prefix"]+"/rm" in self.settings:
                                for x in self.settings[self.settings["spec_prefix"]+"/rm"]:
                                        """
                                        We're going to shell out for all these cleaning
@@ -1134,7 +1134,7 @@ class generic_stage_target(generic_target):
                                        raise
 
        def preclean(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"preclean"):
                        print "Resume point detected, skipping preclean operation..."
                else:
@@ -1149,7 +1149,7 @@ class generic_stage_target(generic_target):
                                raise CatalystError, "Build failed, could not execute preclean"
 
        def capture(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"capture"):
                        print "Resume point detected, skipping capture operation..."
                else:
@@ -1174,7 +1174,7 @@ class generic_stage_target(generic_target):
                        touch(self.settings["autoresume_path"]+"capture")
 
        def run_local(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"run_local"):
                        print "Resume point detected, skipping run_local operation..."
                else:
@@ -1211,7 +1211,7 @@ class generic_stage_target(generic_target):
                                        self.env[varname]="true"
                                else:
                                        self.env[varname]="false"
-               if self.settings.has_key("makeopts"):
+               if "makeopts" in self.settings:
                        self.env["MAKEOPTS"]=self.settings["makeopts"]
 
        def run(self):
@@ -1223,14 +1223,14 @@ class generic_stage_target(generic_target):
                """ Check for mounts right away and abort if we cannot unmount them """
                self.mount_safety_check()
 
-               if self.settings.has_key("CLEAR_AUTORESUME"):
+               if "CLEAR_AUTORESUME" in self.settings:
                        self.clear_autoresume()
 
-               if self.settings.has_key("PURGEONLY"):
+               if "PURGEONLY" in self.settings:
                        self.purge()
                        return
 
-               if self.settings.has_key("PURGE"):
+               if "PURGE" in self.settings:
                        self.purge()
 
                for x in self.settings["action_sequence"]:
@@ -1245,11 +1245,11 @@ class generic_stage_target(generic_target):
                self.chroot_lock.unlock()
 
        def unmerge(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"unmerge"):
                        print "Resume point detected, skipping unmerge operation..."
                else:
-                       if self.settings.has_key(self.settings["spec_prefix"]+"/unmerge"):
+                       if self.settings["spec_prefix"]+"/unmerge" in self.settings:
                                if type(self.settings[self.settings["spec_prefix"]+\
                                        "/unmerge"])==types.StringType:
                                        self.settings[self.settings["spec_prefix"]+"/unmerge"]=\
@@ -1277,7 +1277,7 @@ class generic_stage_target(generic_target):
                                touch(self.settings["autoresume_path"]+"unmerge")
 
        def target_setup(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"target_setup"):
                        print "Resume point detected, skipping target_setup operation..."
                else:
@@ -1288,11 +1288,11 @@ class generic_stage_target(generic_target):
                        touch(self.settings["autoresume_path"]+"target_setup")
 
        def setup_overlay(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                and os.path.exists(self.settings["autoresume_path"]+"setup_overlay"):
                        print "Resume point detected, skipping setup_overlay operation..."
                else:
-                       if self.settings.has_key(self.settings["spec_prefix"]+"/overlay"):
+                       if self.settings["spec_prefix"]+"/overlay" in self.settings:
                                for x in self.settings[self.settings["spec_prefix"]+"/overlay"]: 
                                        if os.path.exists(x):
                                                cmd("rsync -a "+x+"/ "+\
@@ -1302,12 +1302,12 @@ class generic_stage_target(generic_target):
                                touch(self.settings["autoresume_path"]+"setup_overlay")
 
        def create_iso(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"create_iso"):
                        print "Resume point detected, skipping create_iso operation..."
                else:
                        """ Create the ISO """
-                       if self.settings.has_key("iso"):
+                       if "iso" in self.settings:
                                cmd("/bin/bash "+self.settings["controller_file"]+" iso "+\
                                        self.settings["iso"],"ISO creation script failed.",\
                                        env=self.env)
@@ -1319,13 +1319,13 @@ class generic_stage_target(generic_target):
                                print "An ISO Image will not be created."
 
        def build_packages(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+\
                                "build_packages"):
                        print "Resume point detected, skipping build_packages operation..."
                else:
-                       if self.settings.has_key(self.settings["spec_prefix"]+"/packages"):
-                               if self.settings.has_key("AUTORESUME") \
+                       if self.settings["spec_prefix"]+"/packages" in self.settings:
+                               if "AUTORESUME" in self.settings \
                                        and os.path.exists(self.settings["autoresume_path"]+\
                                                "build_packages"):
                                        print "Resume point detected, skipping build_packages operation..."
@@ -1344,11 +1344,11 @@ class generic_stage_target(generic_target):
                                                        "build aborting due to error."
 
        def build_kernel(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"build_kernel"):
                        print "Resume point detected, skipping build_kernel operation..."
                else:
-                       if self.settings.has_key("boot/kernel"):
+                       if "boot/kernel" in self.settings:
                                try:
                                        mynames=self.settings["boot/kernel"]
                                        if type(mynames)==types.StringType:
@@ -1361,7 +1361,7 @@ class generic_stage_target(generic_target):
                                                env=self.env)
 
                                        for kname in mynames:
-                                               if self.settings.has_key("AUTORESUME") \
+                                               if "AUTORESUME" in self.settings \
                                                        and os.path.exists(self.settings["autoresume_path"]\
                                                                +"build_kernel_"+kname):
                                                        print "Resume point detected, skipping build_kernel for "+kname+" operation..."
@@ -1468,7 +1468,7 @@ class generic_stage_target(generic_target):
                                                "build aborting due to kernel build error."
 
        def bootloader(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"bootloader"):
                        print "Resume point detected, skipping bootloader operation..."
                else:
@@ -1482,7 +1482,7 @@ class generic_stage_target(generic_target):
                                raise CatalystError,"Script aborting due to error."
 
        def livecd_update(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+\
                                "livecd_update"):
                        print "Resume point detected, skipping build_packages operation..."
@@ -1515,7 +1515,7 @@ class generic_stage_target(generic_target):
                        os.chmod(myemp,mystat[ST_MODE])
 
        def clear_packages(self):
-               if self.settings.has_key("PKGCACHE"):
+               if "PKGCACHE" in self.settings:
                        print "purging the pkgcache ..."
 
                        myemp=self.settings["pkgcache_path"]
@@ -1533,7 +1533,7 @@ class generic_stage_target(generic_target):
                                os.chmod(myemp,mystat[ST_MODE])
 
        def clear_kerncache(self):
-               if self.settings.has_key("KERNCACHE"):
+               if "KERNCACHE" in self.settings:
                        print "purging the kerncache ..."
 
                        myemp=self.settings["kerncache_path"]
@@ -1552,11 +1552,11 @@ class generic_stage_target(generic_target):
 
        def clear_autoresume(self):
                """ Clean resume points since they are no longer needed """
-               if self.settings.has_key("AUTORESUME"):
+               if "AUTORESUME" in self.settings:
                        print "Removing AutoResume Points: ..."
                myemp=self.settings["autoresume_path"]
                if os.path.isdir(myemp):
-                               if self.settings.has_key("AUTORESUME"):
+                               if "AUTORESUME" in self.settings:
                                        print "Emptying directory",myemp
                                """
                                stat the dir, delete the dir, recreate the dir and set
@@ -1576,7 +1576,7 @@ class generic_stage_target(generic_target):
        def gen_contents_file(self,file):
                if os.path.exists(file+".CONTENTS"):
                        os.remove(file+".CONTENTS")
-               if self.settings.has_key("contents"):
+               if "contents" in self.settings:
                        if os.path.exists(file):
                                myf=open(file+".CONTENTS","w")
                                keys={}
@@ -1586,7 +1586,7 @@ class generic_stage_target(generic_target):
                                        array.sort()
                                for j in array:
                                        contents=generate_contents(file,contents_function=j,\
-                                               verbose=self.settings.has_key("VERBOSE"))
+"VERBOSE" in                                           verbose=self.settings)
                                        if contents:
                                                myf.write(contents)
                                myf.close()
@@ -1594,7 +1594,7 @@ class generic_stage_target(generic_target):
        def gen_digest_file(self,file):
                if os.path.exists(file+".DIGESTS"):
                        os.remove(file+".DIGESTS")
-               if self.settings.has_key("digests"):
+               if "digests" in self.settings:
                        if os.path.exists(file):
                                myf=open(file+".DIGESTS","w")
                                keys={}
@@ -1607,18 +1607,18 @@ class generic_stage_target(generic_target):
                                                if "all" in array:
                                                        for k in hash_map.keys():
                                                                hash=generate_hash(f,hash_function=k,verbose=\
-                                                                       self.settings.has_key("VERBOSE"))
+"VERBOSE" in                                                                   self.settings)
                                                                myf.write(hash)
                                                else:
                                                        for j in array:
                                                                hash=generate_hash(f,hash_function=j,verbose=\
-                                                                       self.settings.has_key("VERBOSE"))
+"VERBOSE" in                                                                   self.settings)
                                                                myf.write(hash)
                                myf.close()
 
        def purge(self):
                countdown(10,"Purging Caches ...")
-               if self.settings.has_key("PURGE") or self.settings.has_key("PURGEONLY"):
+               if "PURGE" in self.settings or "PURGEONLY" in self.settings:
                        print "clearing autoresume ..."
                        self.clear_autoresume()
 
index a805bf3a771b8ad1d9af2c56c368753e7c84f6bc..e2f7ff08c1a16ed45797b0ab094d5491b5955649 100644 (file)
@@ -14,14 +14,14 @@ class grp_target(generic_stage_target):
                
                self.valid_values=self.required_values[:]
                self.valid_values.extend(["grp/use"])
-               if not addlargs.has_key("grp"):
+               if not "grp" in addlargs:
                        raise CatalystError,"Required value \"grp\" not specified in spec."
                
                self.required_values.extend(["grp"])
                if type(addlargs["grp"])==types.StringType:
                        addlargs["grp"]=[addlargs["grp"]]
                
-               if addlargs.has_key("grp/use"):
+               if "grp/use" in addlargs:
                    if type(addlargs["grp/use"])==types.StringType:
                            addlargs["grp/use"]=[addlargs["grp/use"]]
                        
@@ -33,7 +33,7 @@ class grp_target(generic_stage_target):
 
        def set_target_path(self):
                self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+"/")
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
                        print "Resume point detected, skipping target path setup operation..."
                else:
@@ -60,7 +60,7 @@ class grp_target(generic_stage_target):
 
        def set_use(self):
            generic_stage_target.set_use(self)
-           if self.settings.has_key("use"):
+           if "use" in self.settings:
                self.settings["use"].append("bindist")
            else:
                self.settings["use"]=["bindist"]
index eef4896b7cdb715561bdcfe755cfa7219082802f..27432108211815d279f9d254d7f81d56f44bc919 100644 (file)
@@ -21,7 +21,7 @@ class livecd_stage1_target(generic_stage_target):
                                        "unbind", "clean","clear_autoresume"]
        def set_target_path(self):
                self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"])
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
                                print "Resume point detected, skipping target path setup operation..."
                else:
@@ -42,7 +42,7 @@ class livecd_stage1_target(generic_stage_target):
        
        def set_use(self):
                generic_stage_target.set_use(self)
-               if self.settings.has_key("use"):
+               if "use" in self.settings:
                        self.settings["use"].append("livecd")
                        self.settings["use"].append("bindist")
                else:
@@ -51,14 +51,14 @@ class livecd_stage1_target(generic_stage_target):
 
        def set_packages(self):
                generic_stage_target.set_packages(self)
-               if self.settings.has_key(self.settings["spec_prefix"]+"/packages"):
+               if self.settings["spec_prefix"]+"/packages" in self.settings:
                        if type(self.settings[self.settings["spec_prefix"]+"/packages"]) == types.StringType:
                                self.settings[self.settings["spec_prefix"]+"/packages"] = \
                                        self.settings[self.settings["spec_prefix"]+"/packages"].split()
                self.settings[self.settings["spec_prefix"]+"/packages"].append("app-misc/livecd-tools")
 
        def set_pkgcache_path(self):
-               if self.settings.has_key("pkgcache_path"):
+               if "pkgcache_path" in self.settings:
                        if type(self.settings["pkgcache_path"]) != types.StringType:
                                self.settings["pkgcache_path"]=normpath(string.join(self.settings["pkgcache_path"]))
                else:
index ea5d9ecc78257d5a0f35f568ec813a3703812dd8..cef47106cf580e174a0e6a2ae53bcdd374729808 100644 (file)
@@ -24,7 +24,7 @@ class livecd_stage2_target(generic_stage_target):
                        "gamecd/conf","livecd/xdm","livecd/xsession","livecd/volid"])
                
                generic_stage_target.__init__(self,spec,addlargs)
-               if not self.settings.has_key("livecd/type"):
+               if not "livecd/type" in self.settings:
                        self.settings["livecd/type"] = "generic-livecd"
 
                file_locate(self.settings, ["cdtar","controller_file"])
@@ -43,7 +43,7 @@ class livecd_stage2_target(generic_stage_target):
 
        def set_target_path(self):
                self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+"/")
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
                                print "Resume point detected, skipping target path setup operation..."
                else:
@@ -57,7 +57,7 @@ class livecd_stage2_target(generic_stage_target):
 
        def run_local(self):
                # what modules do we want to blacklist?
-               if self.settings.has_key("livecd/modblacklist"):
+               if "livecd/modblacklist" in self.settings:
                        try:
                                myf=open(self.settings["chroot_path"]+"/etc/hotplug/blacklist","a")
                        except:
@@ -82,12 +82,12 @@ class livecd_stage2_target(generic_stage_target):
                        error_msg="Rsync of "+self.settings["source_path"]+" to "+self.settings["chroot_path"]+" failed."
                        invalid_snapshot=False
 
-               if self.settings.has_key("AUTORESUME"):
+               if "AUTORESUME" in self.settings:
                        if os.path.isdir(self.settings["source_path"]) and \
                                os.path.exists(self.settings["autoresume_path"]+"unpack"):
                                print "Resume point detected, skipping unpack operation..."
                                unpack=False
-                       elif self.settings.has_key("source_path_hash"):
+                       elif "source_path_hash" in self.settings:
                                if self.settings["source_path_hash"] != clst_unpack_hash:
                                        invalid_snapshot=True
 
@@ -106,7 +106,7 @@ class livecd_stage2_target(generic_stage_target):
                        if not os.path.exists(self.settings["chroot_path"]+"/tmp"):
                                os.makedirs(self.settings["chroot_path"]+"/tmp",1777)
 
-                       if self.settings.has_key("PKGCACHE"):
+                       if "PKGCACHE" in self.settings:
                                if not os.path.exists(self.settings["pkgcache_path"]):
                                        os.makedirs(self.settings["pkgcache_path"],0755)
 
@@ -116,7 +116,7 @@ class livecd_stage2_target(generic_stage_target):
                        print display_msg
                        cmd(unpack_cmd,error_msg,env=self.env)
 
-                       if self.settings.has_key("source_path_hash"):
+                       if "source_path_hash" in self.settings:
                                myf=open(self.settings["autoresume_path"]+"unpack","w")
                                myf.write(self.settings["source_path_hash"])
                                myf.close()
@@ -128,7 +128,7 @@ class livecd_stage2_target(generic_stage_target):
                                "config_profile_link","setup_confdir","portage_overlay",\
                                "bind","chroot_setup","setup_environment","run_local",\
                                "build_kernel"]
-               if not self.settings.has_key("FETCH"):
+               if not "FETCH" in self.settings:
                        self.settings["action_sequence"] += ["bootloader","preclean",\
                                "livecd_update","root_overlay","fsscript","rcupdate","unmerge",\
                                "unbind","remove","empty","target_setup",\
index 675ee901d367cad22763ac85ce3baeaf306847a8..6b576b47c65acc955374dd26ed738d4d821c7cb0 100644 (file)
@@ -22,7 +22,7 @@ class netboot_target(generic_stage_target):
                self.required_values=[]
                        
                try:
-                       if addlargs.has_key("netboot/packages"):
+                       if "netboot/packages" in addlargs:
                                if type(addlargs["netboot/packages"]) == types.StringType:
                                        loopy=[addlargs["netboot/packages"]]
                                else:
@@ -38,7 +38,7 @@ class netboot_target(generic_stage_target):
 
                generic_stage_target.__init__(self,spec,addlargs)
                self.set_build_kernel_vars(addlargs)
-               if addlargs.has_key("netboot/busybox_config"):
+               if "netboot/busybox_config" in addlargs:
                        file_locate(self.settings, ["netboot/busybox_config"])
 
                # Custom Kernel Tarball --- use that instead ...
@@ -46,7 +46,7 @@ class netboot_target(generic_stage_target):
                # unless the user wants specific CFLAGS/CXXFLAGS, let's use -Os
                
                for envvar in "CFLAGS", "CXXFLAGS":
-                       if not os.environ.has_key(envvar) and not addlargs.has_key(envvar):
+                       if not envvar in os.environ and not envvar in addlargs:
                                self.settings[envvar] = "-Os -pipe"
        
 
@@ -57,7 +57,7 @@ class netboot_target(generic_stage_target):
 
 #      def build_packages(self):
 #              # build packages
-#              if self.settings.has_key("netboot/packages"):
+#              if "netboot/packages" in self.settings:
 #                      mypack=list_bashify(self.settings["netboot/packages"])
 #              try:
 #                      cmd("/bin/bash "+self.settings["controller_file"]+" packages "+mypack,env=self.env)
@@ -67,7 +67,7 @@ class netboot_target(generic_stage_target):
        
        def build_busybox(self):
                # build busybox
-               if self.settings.has_key("netboot/busybox_config"):
+               if "netboot/busybox_config" in self.settings:
                        mycmd = self.settings["netboot/busybox_config"]
                else:
                        mycmd = ""
@@ -81,20 +81,20 @@ class netboot_target(generic_stage_target):
        def copy_files_to_image(self):
                # create image
                myfiles=[]
-               if self.settings.has_key("netboot/packages"):
+               if "netboot/packages" in self.settings:
                        if type(self.settings["netboot/packages"]) == types.StringType:
                                loopy=[self.settings["netboot/packages"]]
                        else:
                                loopy=self.settings["netboot/packages"]
                
                for x in loopy:
-                       if self.settings.has_key("netboot/packages/"+x+"/files"):
+                       if "netboot/packages/"+x+"/files" in self.settings:
                            if type(self.settings["netboot/packages/"+x+"/files"]) == types.ListType:
                                    myfiles.extend(self.settings["netboot/packages/"+x+"/files"])
                            else:
                                    myfiles.append(self.settings["netboot/packages/"+x+"/files"])
 
-               if self.settings.has_key("netboot/extra_files"):
+               if "netboot/extra_files" in self.settings:
                        if type(self.settings["netboot/extra_files"]) == types.ListType:
                                myfiles.extend(self.settings["netboot/extra_files"])
                        else:
index cfb08d37a9000608dc3adf47263810df42dbc45d..08ef6802f2b7314c4de91231121aeef9fac0e1fc 100644 (file)
@@ -24,7 +24,7 @@ class netboot2_target(generic_stage_target):
                ])
 
                try:
-                       if addlargs.has_key("netboot2/packages"):
+                       if "netboot2/packages" in addlargs:
                                if type(addlargs["netboot2/packages"]) == types.StringType:
                                        loopy=[addlargs["netboot2/packages"]]
                                else:
@@ -42,7 +42,7 @@ class netboot2_target(generic_stage_target):
        def set_target_path(self):
                self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+\
                        self.settings["target_subpath"]+"/")
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
                                print "Resume point detected, skipping target path setup operation..."
                else:
@@ -60,24 +60,24 @@ class netboot2_target(generic_stage_target):
                myfiles=[]
 
                # check for autoresume point
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"copy_files_to_image"):
                                print "Resume point detected, skipping target path setup operation..."
                else:
-                       if self.settings.has_key("netboot2/packages"):
+                       if "netboot2/packages" in self.settings:
                                if type(self.settings["netboot2/packages"]) == types.StringType:
                                        loopy=[self.settings["netboot2/packages"]]
                                else:
                                        loopy=self.settings["netboot2/packages"]
                
                        for x in loopy:
-                               if self.settings.has_key("netboot2/packages/"+x+"/files"):
+                               if "netboot2/packages/"+x+"/files" in self.settings:
                                    if type(self.settings["netboot2/packages/"+x+"/files"]) == types.ListType:
                                            myfiles.extend(self.settings["netboot2/packages/"+x+"/files"])
                                    else:
                                            myfiles.append(self.settings["netboot2/packages/"+x+"/files"])
 
-                       if self.settings.has_key("netboot2/extra_files"):
+                       if "netboot2/extra_files" in self.settings:
                                if type(self.settings["netboot2/extra_files"]) == types.ListType:
                                        myfiles.extend(self.settings["netboot2/extra_files"])
                                else:
@@ -93,11 +93,11 @@ class netboot2_target(generic_stage_target):
                        touch(self.settings["autoresume_path"]+"copy_files_to_image")
 
        def setup_overlay(self):        
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                and os.path.exists(self.settings["autoresume_path"]+"setup_overlay"):
                        print "Resume point detected, skipping setup_overlay operation..."
                else:
-                       if self.settings.has_key("netboot2/overlay"):
+                       if "netboot2/overlay" in self.settings:
                                for x in self.settings["netboot2/overlay"]: 
                                        if os.path.exists(x):
                                                cmd("rsync -a "+x+"/ "+\
@@ -117,11 +117,11 @@ class netboot2_target(generic_stage_target):
                        raise CatalystError,"Failed to move kernel images!"
 
        def remove(self):
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"remove"):
                        print "Resume point detected, skipping remove operation..."
                else:
-                       if self.settings.has_key(self.settings["spec_prefix"]+"/rm"):
+                       if self.settings["spec_prefix"]+"/rm" in self.settings:
                                for x in self.settings[self.settings["spec_prefix"]+"/rm"]:
                                        # we're going to shell out for all these cleaning operations,
                                        # so we get easy glob handling
@@ -129,11 +129,11 @@ class netboot2_target(generic_stage_target):
                                        os.system("rm -rf " + self.settings["chroot_path"] + self.settings["merge_path"] + x)
 
        def empty(self):                
-               if self.settings.has_key("AUTORESUME") \
+               if "AUTORESUME" in self.settings \
                        and os.path.exists(self.settings["autoresume_path"]+"empty"):
                        print "Resume point detected, skipping empty operation..."
                else:
-                       if self.settings.has_key("netboot2/empty"):
+                       if "netboot2/empty" in self.settings:
                                if type(self.settings["netboot2/empty"])==types.StringType:
                                        self.settings["netboot2/empty"]=self.settings["netboot2/empty"].split()
                                for x in self.settings["netboot2/empty"]:
index 8f7a7bcb50ce4d86ec6ab9aeb78137b54d3bacf4..71ddd08c75e59b13ab885859caf8098cee41be6e 100644 (file)
@@ -29,11 +29,11 @@ class snapshot_target(generic_stage_target):
                pass
                
        def run(self):
-               if self.settings.has_key("PURGEONLY"):
+               if "PURGEONLY" in self.settings:
                        self.purge()
                        return
 
-               if self.settings.has_key("PURGE"):
+               if "PURGE" in self.settings:
                        self.purge()
 
                self.setup()
index 3bcfe8039e294ee7955b766421e225aff0ee1ee6..f076745d49de5d071e5aca47b642713d788b952b 100644 (file)
@@ -34,24 +34,24 @@ class stage1_target(generic_stage_target):
        # XXX: How do these override_foo() functions differ from the ones in generic_stage_target and why aren't they in stage3_target?
 
        def override_chost(self):
-               if self.settings.has_key("chost"):
+               if "chost" in self.settings:
                        self.settings["CHOST"]=list_to_string(self.settings["chost"])
 
        def override_cflags(self):
-               if self.settings.has_key("cflags"):
+               if "cflags" in self.settings:
                        self.settings["CFLAGS"]=list_to_string(self.settings["cflags"])
 
        def override_cxxflags(self):
-               if self.settings.has_key("cxxflags"):
+               if "cxxflags" in self.settings:
                        self.settings["CXXFLAGS"]=list_to_string(self.settings["cxxflags"])
 
        def override_ldflags(self):
-               if self.settings.has_key("ldflags"):
+               if "ldflags" in self.settings:
                        self.settings["LDFLAGS"]=list_to_string(self.settings["ldflags"])
 
        def set_portage_overlay(self):
                generic_stage_target.set_portage_overlay(self)
-               if self.settings.has_key("portage_overlay"):
+               if "portage_overlay" in self.settings:
                        print "\nWARNING !!!!!"
                        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."
index fdaacb99b99d22ea543197ab66c01832bafa3488..b5ab3794e1a37143217c5b892a44b582c8cbb750 100644 (file)
@@ -13,7 +13,7 @@ class stage2_target(generic_stage_target):
                generic_stage_target.__init__(self,spec,addlargs)
                
        def set_source_path(self):
-               if self.settings.has_key("SEEDCACHE") and os.path.isdir(normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")):
+               if "SEEDCACHE" in self.settings and os.path.isdir(normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")):
                        self.settings["source_path"]=normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")
                else:
                        self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2")
@@ -35,24 +35,24 @@ class stage2_target(generic_stage_target):
                self.settings["cleanables"].extend(["/etc/portage"])
        
        def override_chost(self):
-               if self.settings.has_key("chost"):
+               if "chost" in self.settings:
                        self.settings["CHOST"]=list_to_string(self.settings["chost"])
 
        def override_cflags(self):
-               if self.settings.has_key("cflags"):
+               if "cflags" in self.settings:
                        self.settings["CFLAGS"]=list_to_string(self.settings["cflags"])
 
        def override_cxxflags(self):
-               if self.settings.has_key("cxxflags"):
+               if "cxxflags" in self.settings:
                        self.settings["CXXFLAGS"]=list_to_string(self.settings["cxxflags"])
 
        def override_ldflags(self):
-               if self.settings.has_key("ldflags"):
+               if "ldflags" in self.settings:
                        self.settings["LDFLAGS"]=list_to_string(self.settings["ldflags"])
 
        def set_portage_overlay(self):
                        generic_stage_target.set_portage_overlay(self)
-                       if self.settings.has_key("portage_overlay"):
+                       if "portage_overlay" in self.settings:
                                print "\nWARNING !!!!!"
                                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."
index 2c9ad1baea4a68afdc2ef94b66591632b33111a8..d7d6538ec085fefbbe9ed70e8ae59b2cf996ff26 100644 (file)
@@ -14,7 +14,7 @@ class stage3_target(generic_stage_target):
 
        def set_portage_overlay(self):
                generic_stage_target.set_portage_overlay(self)
-               if self.settings.has_key("portage_overlay"):
+               if "portage_overlay" in self.settings:
                        print "\nWARNING !!!!!"
                        print "\tUsing an overlay for earlier stages could cause build issues."
                        print "\tIf you break it, you buy it. Don't complain to us about it."
index 08c4105adb65cb2ef839f7d87d81fbafb39fff15..f64b4b8fea5b9fa0e70c4ac261b991e13c8b4c55 100644 (file)
@@ -28,9 +28,9 @@ class stage4_target(generic_stage_target):
                                        "preclean","rcupdate","unmerge","unbind","remove","empty",\
                                        "clean"]
 
-#              if self.settings.has_key("TARBALL") or \
-#                      not self.settings.has_key("FETCH"):
-               if not self.settings.has_key("FETCH"):
+#              if "TARBALL" in self.settings or \
+#                      not "FETCH" in self.settings:
+               if not "FETCH" in self.settings:
                        self.settings["action_sequence"].append("capture")
                self.settings["action_sequence"].append("clear_autoresume")