Skip to content

Commit

Permalink
offline the slave after it's been set up
Browse files Browse the repository at this point in the history
RHOSINFRA-2945
  • Loading branch information
wznoinsk committed Jan 30, 2020
1 parent 3b790e6 commit 97dc702
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions devnest/lib/jenkins.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,19 +186,16 @@ def create_update_node_from_xml(self, xml_path, directory=False):
% baseurl,
data=config_str)

LOG.info("Take the slave offline after it's been set up")
self.jenkins.requester.post_and_confirm_status("%s/doDisconnect"
% baseurl, data={'offlineMessage': offlineMessage})

except JenkinsAPIException:
LOG.debug('Node %s not found, adding new' % slave_name)
self.jenkins.create_node(slave_name, labels='devnest_creating_a_new_slave')
self.jenkins.requester.post_and_confirm_status("%s/config.xml"
% baseurl,
data=config_str)

finally:
LOG.info("Take the slave offline after it's been set up")
self.jenkins.requester.post_and_confirm_status("%s/doDisconnect"
self.jenkins.requester.post_and_confirm_status("%s/toggleOffline"
% baseurl, data={'offlineMessage': offlineMessage})

LOG.info('Node %s updated' % slave_name)
Expand Down

0 comments on commit 97dc702

Please sign in to comment.