Nicer error if windows prefix is not configured when it is required. split
authorCarl Hetherington <cth@carlh.net>
Thu, 10 Dec 2015 09:22:45 +0000 (09:22 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 10 Dec 2015 09:22:45 +0000 (09:22 +0000)
cdist/target.py

index b4f7727b60adf9f6a7f48f07bb3219a56a5e2303..434d7d335e7db6c47a1113eb364fbf30f2f906f7 100644 (file)
@@ -92,6 +92,8 @@ class WindowsTarget(Target):
         super(WindowsTarget, self).__init__('windows', directory)
         self.bits = bits
 
+        if globals.config.get('windows_environment_prefix') is None:
+            raise Error('windows prefix not configured')
         self.windows_prefix = '%s/%d' % (globals.config.get('windows_environment_prefix'), self.bits)
         if not os.path.exists(self.windows_prefix):
             raise Error('windows prefix %s does not exist' % self.windows_prefix)
@@ -291,4 +293,3 @@ def factory(s, debug, work):
 
     target.debug = debug
     return target
-