Added the ability to get at the config.xml from a job
authorRamon van Alteren <ramon@vanalteren.nl>
Wed, 8 Feb 2012 13:43:23 +0000 (14:43 +0100)
committerRamon van Alteren <ramon@vanalteren.nl>
Wed, 8 Feb 2012 14:13:34 +0000 (15:13 +0100)
Jobs expose their configuration through an xml file which can be retrieved through the api.
Right now this method returns the raw xml as \n terminated strings.

This may change in the future to support more useful xml based structures

jenkinsapi/job.py

index 7e5d8eb9221490e740366ad03ef6a9cf9149ddd8..6de5f2bef0b4006baaa3548e60a518940761f814 100644 (file)
@@ -196,3 +196,7 @@ class Job(JenkinsBase):
         except NoBuildData:
             log.info("No build info available for %s, assuming not running." % str(self) )
             return False
+
+    def get_config(self):
+        '''Returns the config.xml from the job'''
+        return self.hit_url("%(baseurl)s/config.xml" % self.__dict__)