fix up volume shortening substituions to actually work

This commit is contained in:
Dennis Gilmore 2014-07-31 04:23:17 -05:00
parent ea8f3909ac
commit 6177cf6f88

View File

@ -1358,13 +1358,13 @@ class Pungi(pypungi.PungiBase):
arch = self.tree_arch arch = self.tree_arch
for k, v in subsitutions.iteritems(): for k, v in subsitutions.iteritems():
if name.contains(k): if k in name:
name.replace(k, v) name = name.replace(k, v)
if version.contains(k): if k in version:
version.replace(k, v) version = version.replace(k, v)
volid = "%s-%s-%s" % (name, version, arch) volid = "%s-%s-%s" % (name, version, arch)
if len(volid) > 32: if len(volid) > 32:
raise RuntimeError("Volume ID %s is longer than 32 characters") raise RuntimeError("Volume ID %s is longer than 32 characters" % volid)
else: else:
return volid return volid