diff --git a/set_app_domain.py b/set_app_domain.py index 9c89be863d96a26178b67ac579faad73d6f1abee..8b2c0db1418bc993ebe756ec7d57c790c7c32758 100755 --- a/set_app_domain.py +++ b/set_app_domain.py @@ -3,7 +3,6 @@ ''' Script to set the domain of an existing MediaServer, Miris Manager or Monitor ''' -import apt import os import re import subprocess @@ -163,13 +162,10 @@ class SetAppDomain(): with open('/etc/hosts', 'w') as fo: fo.write(new_hosts) log('The "/etc/hosts" file has been update.') - cache = apt.Cache() - cache.open() try: - cache['nscd'].is_installed utils.run_commands(['service nscd restart']) - except KeyError: - pass + except Exception as nscd_err: + log(nscd_err) else: log('The "/etc/hosts" file is already up to date.')