-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Know that config thing? Let's actually use it :P
- Loading branch information
Showing
1 changed file
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |