forked from outlyerapp/plugins
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub.py
More file actions
Latest commit
27 lines (24 loc) · 615 Bytes
/
Copy pathgithub.py
File metadata and controls
27 lines (24 loc) · 615 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#### github.py
#
# Monitors the Github Status Api and
# reports back on platform availability.
#
# (c) DevopsGuys Ltd/Matthew Macdonald-Wallace 2016
#
# Made available under the MIT license
importjson
importrequests
importsys
status_uri='https://status.github.com/api/status.json'
r=requests.get(status_uri)
gh_status=json.loads(r.text)
ifgh_status['status'] =="major":
exit_code=2
elifgh_status['status'] =="minor":
exit_code=1
elifgh_status['status'] =="good":
exit_code=0
else:
exit_code=3
print"Current github status is %s"%gh_status['status']
sys.exit(exit_code)