From e073e0a032b77b66954ff392355f646a4c710dbb Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Tue, 10 Feb 2009 14:49:59 -0800 Subject: [PATCH] More generisizing of _doIsoChecksum --- src/pypungi/__init__.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/pypungi/__init__.py b/src/pypungi/__init__.py index 4966f9a4..3aa666c9 100644 --- a/src/pypungi/__init__.py +++ b/src/pypungi/__init__.py @@ -925,22 +925,22 @@ cost=500 repofile.write(repocontent) repofile.close() - def _doIsoChecksum(self, path, shafile): - """Simple function to wrap creating sha1sums of iso files.""" + def _doIsoChecksum(self, path, csumfile): + """Simple function to wrap creating checksums of iso files.""" try: - sha1file = open(shafile, 'a') + checkfile = open(csumfile, 'a') except IOError: - self.logger.error("Could not open sha1sum file: %s" % shafile) + self.logger.error("Could not open checksum file: %s" % csumfile) - self.logger.info("Generating sha1sum of %s" % path) - sha1sum = pypungi.util._doCheckSum(path, 'sha1', self.logger) - if sha1sum: - sha1file.write("%s *%s\n" % (sha1sum.replace('sha1:', ''), os.path.basename(path))) + self.logger.info("Generating checksum of %s" % path) + checksum = pypungi.util._doCheckSum(path, 'sha1', self.logger) + if checksum: + checkfile.write("%s *%s\n" % (checksum.replace('sha1:', ''), os.path.basename(path))) else: - self.logger.error('Failed to generate sha1sum for %s' % sha1file) + self.logger.error('Failed to generate checksum for %s' % checkfile) sys.exit(1) - sha1file.close() + checkfile.close() def doCreateIsos(self, split=True): """Create isos of the tree, optionally splitting the tree for split media."""