From: Zachary Vance Date: Fri, 13 Aug 2021 01:02:41 +0000 (-0700) Subject: Add remote host X-Git-Url: https://git.za3k.com/?a=commitdiff_plain;h=2343ef8c5241b3c651f9e5763242bd871a94c923;p=mqlg.git Add remote host --- diff --git a/main.py b/main.py old mode 100644 new mode 100755 index 261ae54..915eea6 --- a/main.py +++ b/main.py @@ -1,6 +1,6 @@ -#!/usr/local/bin python3 +#!/usr/bin/env python3 import pika, requests -import base64, concurrent.futures, functools, logging, json, tempfile, time, multiprocessing, os, shutil, sys +import base64, concurrent.futures, functools, logging, json, tempfile, time, multiprocessing, os, shutil, socket, sys import lib, sm logging.basicConfig(filename='/var/log/mqlg.log', @@ -18,14 +18,14 @@ FF_TAR_RESP="ff_tar_resp" LG_TAR="lg_tar" LG_TAR_RESP="lg_tar_resp" +# Treat germinate specially +IS_GERMINATE = socket.gethostname() == "germinate" + # Login credentials -MQ_HOST = "localhost" +MQ_HOST = os.getenv("MQ_HOST", "localhost" if IS_GERMINATE else "germinate.za3k.com") USER="sm" PASS="McFnE9I4OdwTB" -import socket -IS_GERMINATE = False #socket.gethostname() == "germinate" - # Library functions class QueueConnection(): def __init__(self, queues):