diff --git a/pylintrc b/pylintrc index af342e8aa5..a44987ca15 100644 --- a/pylintrc +++ b/pylintrc @@ -70,7 +70,6 @@ disable= E1101, # no-member E1135, # unsupported-membership-test R1703, # simplifiable-if-statement - R1718, # consider-using-set-comprehension R1721, # unnecessary-comprehension W0108, # unnecessary-lambda W0222, # signature-differs diff --git a/sos/collector/__init__.py b/sos/collector/__init__.py index 626602c1b8..4af107f432 100644 --- a/sos/collector/__init__.py +++ b/sos/collector/__init__.py @@ -169,9 +169,9 @@ def __init__(self, parser, parsed_args, cmdline_args): # get the local hostname and addresses to filter from results later self.hostname = socket.gethostname() try: - self.ip_addrs = list(set([ + self.ip_addrs = list({ i[4][0] for i in socket.getaddrinfo(socket.gethostname(), None) - ])) + }) except Exception: # this is almost always a DNS issue with reverse resolution # set a safe fallback and log the issue