Closed manowar689 closed 1 year ago
Workaround:
File path: /usr/local/lib/python3.6/site-packages/jenkinsapi Inside the following path, nodes.py and node.py are the files which are supposed to be edited.
vi nodes.py Previous: def _make_node(self, nodename): """ Creates an instance of Node for the given nodename. This function assumes the returned node exists. """ if nodename.lower() == 'master': nodeurl = '%s/(%s)' % (self.baseurl, nodename) else: nodeurl = '%s/%s' % (self.baseurl, nodename) return Node(self.jenkins, nodeurl, nodename, node_dict={})
Changed: def _make_node(self, nodename): """ Creates an instance of Node for the given nodename. This function assumes the returned node exists. """ if nodename.lower() == 'built-in': nodeurl = '%s/(%s)' % (self.baseurl, nodename) else: nodeurl = '%s/%s' % (self.baseurl, nodename) return Node(self.jenkins, nodeurl, nodename, node_dict={})
vi node.py Previous: self.name = nodename self.jenkins = jenkins_obj if not baseurl: poll = False baseurl = '%s/computer/%s' % (self.jenkins.baseurl, self.name) JenkinsBase.init(self, baseurl, poll=poll) self.node_attributes = node_dict self._element_tree = None self._config = None
Changed: def init(self, jenkins_obj, baseurl, nodename, node_dict, poll=True): self.name = nodename self.jenkins = jenkins_obj if not baseurl: poll = False baseurl = '%s/computer/%s' % (self.jenkins.baseurl, self.name) if "built-in" in baseurl.lower(): self.name = "built-in" baseurl = '%s/computer/(%s)' % (self.jenkins.baseurl.lower(), self.name) JenkinsBase.init(self, baseurl, poll=poll) self.node_attributes = node_dict self._element_tree = None self._config = None
Here I have replaced hardcoded "master" and replaced with "built-in"(As per Jenkins Upgrade) Also added condition for built-in and customized the base url.
Thanks!
Hey HarshalKondhalkar, Thanks again for fixing my issue, the changes you have mentioned above are working, the admins of this package this should be added into the next release as it has solved my issue
This is now fixed in library code. I will do new release soon.
ISSUE TYPE
Jenkinsapi version: latest
Jenkins 2.319.1
SUMMARY
Issue with "Built-In Node" being called, suggest checking the url and file / replacing like so:
EXPECTED RESULTS
ACTUAL RESULTS
USEFUL INFORMATION