We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 231cea3 commit 876678aCopy full SHA for 876678a
jenkinsapi/jenkins.py
@@ -550,9 +550,15 @@ def _wait_for_reboot(self) -> None:
550
def __jenkins_is_unavailable(self):
551
while True:
552
try:
553
- self.requester.get_and_confirm_status(
554
- self.baseurl, valid=[503, 500]
+ res = self.requester.get_and_confirm_status(
+ self.baseurl, valid=[503, 500, 200]
555
)
556
+ # If there is a running job in Jenkins, the system message will
557
+ # pop up but the Jenkins instance will return 200
558
+ if res.status_code == 200 and "Jenkins is going to shut down" in \
559
+ str(res.content, encoding="utf-8"):
560
+ time.sleep(1)
561
+ continue
562
return True
563
except ConnectionError:
564
# This is also a possibility while Jenkins is restarting
0 commit comments