diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py index 6273d511..37861a3c 100644 --- a/src/pylorax/__init__.py +++ b/src/pylorax/__init__.py @@ -1342,26 +1342,25 @@ class BuildStamp(object): def __init__(self, workdir, product, version, bugurl, is_beta, buildarch): self.path = joinpaths(workdir, ".buildstamp") - self.c = ConfigParser.ConfigParser() + + self.product = product + self.version = version + self.bugurl = bugurl + self.is_beta = is_beta now = datetime.datetime.now() now = now.strftime("%Y%m%d%H%M") - uuid = "{0}.{1}".format(now, buildarch) - - section = "main" - data = {"product": product, - "version": version, - "bugurl": bugurl, - "isbeta": is_beta, - "uuid": uuid} - - self.c.add_section(section) - map(lambda (key, value): self.c.set(section, key, value), data.items()) + self.uuid = "{0}.{1}".format(now, buildarch) def write(self): logger.info("writing .buildstamp file") with open(self.path, "w") as fobj: - self.c.write(fobj) + fobj.write("[Main]\n") + fobj.write("BugURL={0.bugurl}\n".format(self)) + fobj.write("IsBeta={0.is_beta}\n".format(self)) + fobj.write("Product={0.product}\n".format(self)) + fobj.write("UUID={0.uuid}\n".format(self)) + fobj.write("Version={0.version}".format(self)) class DiscInfo(object):