From 6177cf6f888fe814a945997c2d38264d1a8a30d4 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 31 Jul 2014 04:23:17 -0500 Subject: [PATCH] fix up volume shortening substituions to actually work --- src/pypungi/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pypungi/__init__.py b/src/pypungi/__init__.py index a1464659..32532952 100644 --- a/src/pypungi/__init__.py +++ b/src/pypungi/__init__.py @@ -1358,13 +1358,13 @@ class Pungi(pypungi.PungiBase): arch = self.tree_arch for k, v in subsitutions.iteritems(): - if name.contains(k): - name.replace(k, v) - if version.contains(k): - version.replace(k, v) + if k in name: + name = name.replace(k, v) + if k in version: + version = version.replace(k, v) volid = "%s-%s-%s" % (name, version, arch) 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: return volid