From db0a064c80973a3b766703c4357da471f1ec28dc Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 6 Nov 2012 14:29:40 -0500 Subject: [PATCH] Bots: Send messages through staging.humbughq.com. (imported from commit d9859bfe5f5b3b7c5efa5ef930d6cfaa5c0d1fc2) --- bots/feedback-bot | 29 ++++++++++------------------- bots/humbug_trac.py | 1 + 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/bots/feedback-bot b/bots/feedback-bot index 292bde5..28efff7 100755 --- a/bots/feedback-bot +++ b/bots/feedback-bot @@ -3,25 +3,16 @@ import sys import os import optparse -usage = """feedback-bot [options] - -Forwards messages from MIT realm users sent to feedback@humbughq.com over to Humbug realm - -Example: feedback-bot --site=http://127.0.0.1:9991 -""" -parser = optparse.OptionParser(usage=usage) -parser.add_option('--site', - dest='site', - default="https://humbughq.com", - action='store') -(options, args) = parser.parse_args() - sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) import api.common -client = api.common.HumbugAPI(email="feedback@humbughq.com", - api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - verbose=True, - site=options.site) +prod_client = api.common.HumbugAPI(email="feedback@humbughq.com", + api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + verbose=True, + site="https://humbughq.com") +staging_client = api.common.HumbugAPI(email="feedback@humbughq.com", + api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + verbose=True, + site="https://staging.humbughq.com") def forward_message(message): forwarded_message = { @@ -30,6 +21,6 @@ def forward_message(message): "subject": "feedback from %s" % message["sender_email"], "content": message["content"], } - client.send_message(forwarded_message) + staging_client.send_message(forwarded_message) -client.call_on_each_message(forward_message) +prod_client.call_on_each_message(forward_message) diff --git a/bots/humbug_trac.py b/bots/humbug_trac.py index 3a4850c..835b2e4 100644 --- a/bots/humbug_trac.py +++ b/bots/humbug_trac.py @@ -21,6 +21,7 @@ import sys sys.path.append("/home/humbug/humbug") import api.common client = api.common.HumbugAPI(email="humbug+trac@humbughq.com", + site="https://staging.humbughq.com", api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") def markdown_ticket_url(ticket, heading="ticket"):