Skip to content

Commit

Permalink
Further updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Iverson authored and Kevin Iverson committed Oct 14, 2013
1 parent ba7009b commit 9cc59e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion stashboard/handlers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,10 @@ def post(self):
class EventHipchatHandler(webapp.RequestHandler):
def post(self):

if not (settings.HIPCHAT_API_KEY):
logging.error('HipChat credentials not configured properly in settings.py')
return

status_color_map = {'Up': 'green', 'Warning': 'yellow', 'Down': 'red'}

service_name = self.request.get('service_name')
Expand All @@ -505,7 +509,7 @@ def post(self):
return

try:
hipster = hipchat.HipChat(token='e7a1310921ddca4bd188d2b36e1059')
hipster = hipchat.HipChat(token=settings.HIPCHAT_API_KEY)
disp_message = '<b>[%s] %s</b><br/> %s' % (status_name, service_name, message)
resp = hipster.method(url='rooms/message', method='POST',
parameters={'room_id': 310850, 'from': 'HF Stausboard',
Expand Down
3 changes: 3 additions & 0 deletions stashboard/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
TWITTER_ACCESS_TOKEN_SECRET = ''
TWITTER_HANDLE = ''

# Hipchat settings
HIPCHAT_API_KEY = ''

# RSS Feed settings
RSS_NUM_EVENTS_TO_FETCH = 50

Expand Down

0 comments on commit 9cc59e2

Please sign in to comment.