From bc15cc0476d080db7818103379f775f5a1bfd608 Mon Sep 17 00:00:00 2001 From: Ross Chadwick Date: Sat, 28 Apr 2018 11:21:04 +0200 Subject: [PATCH] Small patch to ignore missing DNS settings from older versions --- nordnm/__init__.py | 2 +- nordnm/settings.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/nordnm/__init__.py b/nordnm/__init__.py index f510979..35ae50d 100644 --- a/nordnm/__init__.py +++ b/nordnm/__init__.py @@ -1,3 +1,3 @@ __package__ = "nordnm" -__version__ = "0.5.0" +__version__ = "0.5.1" __license__ = "GNU General Public License v3 or later (GPLv3+)" diff --git a/nordnm/settings.py b/nordnm/settings.py index 5cdea2e..fe5d49d 100644 --- a/nordnm/settings.py +++ b/nordnm/settings.py @@ -132,9 +132,8 @@ def get_ping_attempts(self): return self.DEFAULT_PING_ATTEMPTS def get_custom_dns_servers(self) -> list: - custom_dns = self.settings.get('DNS', 'custom-dns-servers') - - if custom_dns: + try: + custom_dns = self.settings.get('DNS', 'custom-dns-servers') return custom_dns.split(' ') - else: + except (configparser.NoSectionError, configparser.NoOptionError): # The setting didn't exist, so ignore it return []