From 79e77b9feb2453b5b4fabb3b71bc379bbf9e5a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Sun, 24 Nov 2019 22:01:31 +0100 Subject: Better dns_names init --- src/main/resources/pl/edu/mimuw/cloudatlas/fetcher/data_fetcher.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/main/resources/pl/edu/mimuw/cloudatlas') diff --git a/src/main/resources/pl/edu/mimuw/cloudatlas/fetcher/data_fetcher.py b/src/main/resources/pl/edu/mimuw/cloudatlas/fetcher/data_fetcher.py index d53ce05..229a35a 100644 --- a/src/main/resources/pl/edu/mimuw/cloudatlas/fetcher/data_fetcher.py +++ b/src/main/resources/pl/edu/mimuw/cloudatlas/fetcher/data_fetcher.py @@ -64,14 +64,13 @@ def get_data(): kernel_ver = platform.release() logged_users = len(psutil.users()) + dns_names = [] try: external_ip = urllib.request.urlopen('https://ident.me').read().decode('utf8') hostname = socket.gethostbyaddr(external_ip) dns_names = ([hostname[0]] + hostname[1])[:3] except Exception as e: pass - else: - dns_names = [] sys.stdout.write("[{},{},{},{},{},{},{},{},{},{},{},{}]\n".format( avg_load, -- cgit v1.2.3