Cope with no-version linux targets.
authorCarl Hetherington <cth@carlh.net>
Sun, 17 Dec 2017 14:42:21 +0000 (14:42 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 17 Dec 2017 14:42:21 +0000 (14:42 +0000)
cdist

diff --git a/cdist b/cdist
index 82df7436d3612f15398546b6f673c3326f29687a..d277d4010683d2e4c99dd9791512d2742a7693f5 100755 (executable)
--- a/cdist
+++ b/cdist
@@ -523,7 +523,10 @@ class LinuxTarget(Target):
         self.set('PATH', '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin')
 
     def setup(self):
-        image = '%s-%s-%s' % (self.distro, self.version, self.bits)
+        if self.version is None:
+            image = '%s-%s' % (self.distro, self.bits)
+        else:
+            image = '%s-%s-%s' % (self.distro, self.version, self.bits)
         mounts = '-v %s:%s ' % (self.directory, self.directory)
         for m in self.mounts:
             mounts += '-v %s:%s ' % (m, m)