Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
3e4954d3
Unverified
Commit
3e4954d3
authored
Jul 12, 2018
by
Nadeem Shahzad
Committed by
GitHub
Jul 12, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4679 from edx/nadeem/OPS-3254
Add retries to notify hipchat (OPS-3254)
parents
5fa7a6cb
7e00beec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
playbooks/roles/supervisor/files/pre_supervisor_checks.py
+16
-2
No files found.
playbooks/roles/supervisor/files/pre_supervisor_checks.py
View file @
3e4954d3
...
@@ -164,8 +164,22 @@ if __name__ == '__main__':
...
@@ -164,8 +164,22 @@ if __name__ == '__main__':
try
:
try
:
if
args
.
hipchat_api_key
:
if
args
.
hipchat_api_key
:
hc
=
hipchat
.
HipChat
(
token
=
args
.
hipchat_api_key
)
hc
=
hipchat
.
HipChat
(
token
=
args
.
hipchat_api_key
)
notify
=
lambda
message
:
hc
.
message_room
(
room_id
=
args
.
hipchat_room
,
def
notify
(
message
):
message_from
=
HIPCHAT_USER
,
message
=
message
)
RETRIES
=
3
last_exception
=
None
for
_
in
range
(
RETRIES
):
try
:
hc
.
message_room
(
room_id
=
args
.
hipchat_room
,
message_from
=
HIPCHAT_USER
,
message
=
message
)
break
except
Exception
as
e
:
last_exception
=
e
else
:
print
(
"Failed to send message on HipChat, {}"
.
format
(
last_exception
))
traceback
.
print_exc
()
except
Exception
as
e
:
except
Exception
as
e
:
print
(
"Failed to initialize hipchat, {}"
.
format
(
e
))
print
(
"Failed to initialize hipchat, {}"
.
format
(
e
))
traceback
.
print_exc
()
traceback
.
print_exc
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment