Skip to content
Snippets Groups Projects
Verified Commit 5f9f052e authored by Nicolas KAROLAK's avatar Nicolas KAROLAK
Browse files

put nscd restart in try except

parent 89c166b2
No related branches found
No related tags found
No related merge requests found
......@@ -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.')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment