Skip to content

Commit

Permalink
Know that config thing? Let's actually use it :P
Browse files Browse the repository at this point in the history
  • Loading branch information
Undo1 committed Aug 24, 2015
1 parent 0909eba commit 2c34497
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion metasmoke.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import json
import requests
from globalvars import GlobalVars


class Metasmoke:
@classmethod
def send_stats_on_post(self, title, reasons):
if GlobalVars.metasmoke_host is None:
print "Metasmoke location not defined, not reporting"
return

try:
payload = {'post': {'title': title, 'reasons': reasons}}

headers = {'Content-type': 'application/json'}
requests.post("http://localhost:3000/posts.json", data=json.dumps(payload), headers=headers)
requests.post(GlobalVars.metasmoke_host + "/posts.json", data=json.dumps(payload), headers=headers)
except Exception as e:
print e

0 comments on commit 2c34497

Please sign in to comment.