[Fedora-livecd-list] Implant md5sum

Ron Yorston rmy at tigress.co.uk
Tue Aug 25 14:55:48 UTC 2009


I've been using the livecd-tools from the CentOS LiveCD Project, but the
same issue seems to apply in Fedora.  If an implantisomd5 binary can't
be found a warning is printed but an attempt is made to run the binary
anyway.  This results in a Python traceback:

isomd5sum not installed; not setting up mediacheck
Traceback (most recent call last):
  File "/usr/bin/livecd-creator", line 133, in ?
    sys.exit(main())
  File "/usr/bin/livecd-creator", line 123, in main
    creator.package()
  File "/usr/lib/python2.4/site-packages/imgcreate/creator.py", line 657, in package
    self._stage_final_image()
  File "/usr/lib/python2.4/site-packages/imgcreate/live.py", line 308, in _stage_final_image
    self.__create_iso(self.__isodir)
  File "/usr/lib/python2.4/site-packages/imgcreate/live.py", line 274, in __create_iso
    self.__implant_md5sum(iso)
  File "/usr/lib/python2.4/site-packages/imgcreate/live.py", line 286, in __implant_md5sum
    subprocess.call([implantisomd5, iso])
UnboundLocalError: local variable 'implantisomd5' referenced before assignment

Sticking in a return statement makes it work:

    def __implant_md5sum(self, iso):
        """Implant an isomd5sum."""
        if os.path.exists("/usr/bin/implantisomd5"):
            implantisomd5 = "/usr/bin/implantisomd5"
        elif os.path.exists("/usr/lib/anaconda-runtime/implantisomd5"):
            implantisomd5 = "/usr/lib/anaconda-runtime/implantisomd5"
        else:
            print >> sys.stderr, \
                  "isomd5sum not installed; not setting up mediacheck"
            return
            
        subprocess.call([implantisomd5, iso])

Ron




More information about the livecd mailing list