build fixes
authorsalimfadhley <sal@stodge.org>
Fri, 14 Jun 2013 23:29:01 +0000 (00:29 +0100)
committersalimfadhley <sal@stodge.org>
Fri, 14 Jun 2013 23:29:01 +0000 (00:29 +0100)
examples/get_config.py [new file with mode: 0644]
jenkinsapi_utils/jenkins_launcher.py

diff --git a/examples/get_config.py b/examples/get_config.py
new file mode 100644 (file)
index 0000000..37474df
--- /dev/null
@@ -0,0 +1,11 @@
+import logging
+logging.basicConfig()
+
+from jenkinsapi.jenkins import Jenkins
+J = Jenkins('http://localhost:8080')
+jobName = 'create_fwrgmkbbzk'
+
+config = J[jobName].get_config()
+
+print config
+
index 3b3c341..aab1fba 100644 (file)
@@ -54,13 +54,6 @@ class JenkinsLancher(object):
         self.q = Queue.Queue()
 
     def update_war(self):
-        if not os.path.exists(self.war_path):
-            with io.open(self.war_path, 'wb') as war_file:
-                log.info("Downloading the Jenkins WAR file")
-                war_response = requests.get(self.JENKINS_WAR_URL)
-                war_file.write(war_response.text)
-            log.info('Done!')
-
         os.chdir(self.war_directory)
         subprocess.check_call('./get-jenkins-war.sh')
 
@@ -104,6 +97,9 @@ class JenkinsLancher(object):
                     if 'Failed to initialize Jenkins' in line:
                         raise FailedToStart(line)
 
+                    if 'Invalid or corrupt jarfile' in line:
+                        raise FailedToStart(line)
+
                     if 'is fully up and running' in line:
                         log.info(line)
                         return