From: Bernhard Tittelbach Date: Sun, 20 Sep 2009 02:26:27 +0000 (+0000) Subject: less error msg clutter on nonexistant socketfile X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=5d61d2377d2a060dc7e60d69fad964154fcf7b64;p=svn42.git less error msg clutter on nonexistant socketfile --- diff --git a/update-web-status.py b/update-web-status.py index a392e0e..e2eec66 100755 --- a/update-web-status.py +++ b/update-web-status.py @@ -197,6 +197,10 @@ RE_REQUEST = re.compile(r'Request: (\w+) (?:Card )?(.+)') RE_ERROR = re.compile(r'Error: (.+)') while True: try: + if not os.path.exists(socketfile): + logging.debug("Socketfile '%s' not found, waiting 5 secs" % socketfile) + time.sleep(5) + continue sockhandle = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sockhandle.connect(socketfile) conn = os.fdopen(sockhandle.fileno()) diff --git a/update-xmpp-status.py b/update-xmpp-status.py index c4bb6d4..f6ee4c0 100644 --- a/update-xmpp-status.py +++ b/update-xmpp-status.py @@ -240,6 +240,10 @@ RE_REQUEST = re.compile(r'Request: (\w+) (?:Card )?(.+)') RE_ERROR = re.compile(r'Error: (.+)') while True: try: + if not os.path.exists(socketfile): + logging.debug("Socketfile '%s' not found, waiting 5 secs" % socketfile) + time.sleep(5) + continue sockhandle = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sockhandle.connect(socketfile) conn = os.fdopen(sockhandle.fileno())