From b619d49c3118d7249d009ee32adffdad4adb27b4 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Sun, 14 Nov 2010 14:28:18 +0100 Subject: [PATCH] allow the ice secret to be passed to syncdb via an envvar --- pyweb/mumble/management/server_detect.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pyweb/mumble/management/server_detect.py b/pyweb/mumble/management/server_detect.py index 98648c2..aa81daf 100644 --- a/pyweb/mumble/management/server_detect.py +++ b/pyweb/mumble/management/server_detect.py @@ -52,8 +52,11 @@ def find_existing_instances( **kwargs ): triedEnviron = False online = False while not online: + env_icesecret = None if not triedEnviron and 'MURMUR_CONNSTR' in os.environ: dbusName = os.environ['MURMUR_CONNSTR'] + if 'MURMUR_ICESECRET' in os.environ: + env_icesecret = os.environ['MURMUR_ICESECRET'] triedEnviron = True if v > 1: print "Trying environment setting", dbusName @@ -80,7 +83,10 @@ def find_existing_instances( **kwargs ): elif dbusName == "2": dbusName = "Meta:tcp -h 127.0.0.1 -p 6502" - icesecret = getpass.getpass("Please enter the Ice secret (if any): ") + if env_icesecret is None: + icesecret = getpass.getpass("Please enter the Ice secret (if any): ") + else: + icesecret = env_icesecret try: ctl = MumbleCtlBase.newInstance( dbusName, settings.SLICE, icesecret )