From 5d61d2377d2a060dc7e60d69fad964154fcf7b64 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Sun, 20 Sep 2009 02:26:27 +0000 Subject: [PATCH] less error msg clutter on nonexistant socketfile --- update-web-status.py | 4 ++++ update-xmpp-status.py | 4 ++++ 2 files changed, 8 insertions(+) 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()) -- 1.7.10.4