Skip to content
This repository was archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
Small patch to ignore missing DNS settings from older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
chadsr committed Apr 28, 2018
1 parent d957c15 commit bc15cc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nordnm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__package__ = "nordnm"
__version__ = "0.5.0"
__version__ = "0.5.1"
__license__ = "GNU General Public License v3 or later (GPLv3+)"
7 changes: 3 additions & 4 deletions nordnm/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []

0 comments on commit bc15cc0

Please sign in to comment.