diff options
author | Salim Fadhley <sal@stodge.org> | 2015-01-13 22:06:09 +0000 |
---|---|---|
committer | Salim Fadhley <sal@stodge.org> | 2015-01-13 22:06:09 +0000 |
commit | d02c2cee5ce31ad35cfd3943ab260a1995b1f6bd (patch) | |
tree | 1451bb638fda3269720c3f0cbae30dabefc438d2 /jenkinsapi | |
parent | ab92e943be109a8f9f3f3bf149be849498ffd57f (diff) | |
parent | c15651ddb02a2fa4f6620e3c0bde204a93fe34b9 (diff) | |
download | python-jenkinsapi-d02c2cee5ce31ad35cfd3943ab260a1995b1f6bd.tar.gz python-jenkinsapi-d02c2cee5ce31ad35cfd3943ab260a1995b1f6bd.tar.bz2 python-jenkinsapi-d02c2cee5ce31ad35cfd3943ab260a1995b1f6bd.zip |
Merge branch 'master' into unstable
Conflicts:
jenkinsapi/job.py
Diffstat (limited to 'jenkinsapi')
-rw-r--r-- | jenkinsapi/job.py | 1 | ||||
-rw-r--r-- | jenkinsapi/queue.py | 2 | ||||
-rw-r--r-- | jenkinsapi/view.py | 27 |
3 files changed, 29 insertions, 1 deletions
diff --git a/jenkinsapi/job.py b/jenkinsapi/job.py index 0ecd54d..ff6122d 100644 --- a/jenkinsapi/job.py +++ b/jenkinsapi/job.py @@ -210,6 +210,7 @@ class Job(JenkinsBase, MutableJenkinsThing): redirect_url = response.headers['location'] if not redirect_url.startswith("%s/queue/item" % self.jenkins.baseurl): + if files: raise ValueError('Builds with file parameters are not ' 'supported by this jenkinsapi version. ' diff --git a/jenkinsapi/queue.py b/jenkinsapi/queue.py index 2e1ff23..0804927 100644 --- a/jenkinsapi/queue.py +++ b/jenkinsapi/queue.py @@ -41,7 +41,7 @@ class Queue(JenkinsBase): for item in self._data['items']: yield item['id'] - def iterivalues(self): + def itervalues(self): for item in self._data['items']: yield QueueItem(self.jenkins, **item) diff --git a/jenkinsapi/view.py b/jenkinsapi/view.py index e06361f..c262804 100644 --- a/jenkinsapi/view.py +++ b/jenkinsapi/view.py @@ -167,6 +167,33 @@ class View(JenkinsBase): def get_nested_view_dict(self): return dict(self._get_nested_views()) + def get_config_xml_url(self): + return '%s/config.xml' % self.baseurl + + def get_config(self): + """ + Return the config.xml from the view + """ + url = self.get_config_xml_url() + response = self.get_jenkins_obj().requester.get_and_confirm_status(url) + return response.text + + def update_config(self, config): + """ + Update the config.xml to the view + """ + url = self.get_config_xml_url() + try: + if isinstance(config, unicode): # pylint: disable=undefined-variable + config = str(config) + except NameError: + # Python3 already a str + pass + + response = self.get_jenkins_obj().requester.post_url( + url, params={}, data=config) + return response.text + @property def views(self): return self.get_jenkins_obj().get_jenkins_obj_from_url(self.baseurl).views |