Tuesday September 25, 2018

Latest Blog Entries

gregh  (1617) 0  - Joined December, 2010

Centos 7 pyzor emails

Centos 7 pyzor emails

Centos 7 pyzor emails on no internet connection

If you run your laptop and there is no internet connection you will get loads of

[abrt] pyzor: client.py:72:send:gaierror: [Errno -2] Name or service not known


To stop this you need to modify the client.py script to handle the error :

def run(self, server, varargs, kwargs=None):
        if kwargs is None:
            kwargs = {}
        message = "%s\t" % str(server)
        response = None
            response = apply(self.routine, varargs, kwargs)
            self.handle_response(response, message)
        except (CommError, KeyError, ValueError), e:
            sys.stderr.write(message + ("%s: %s\n"
                                        % (e.__class__.__name__, e)))
            self.all_ok = False

Change line: except (CommError, KeyError, ValueError) to except (CommError, socket.error, KeyError, ValueError) ie add the socket.error catch.

Cheers Greg

Category : Technology
Published : Sep 18 2018, 12:15:47 PM