Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediaserver
envsetup
Commits
5f9f052e
Verified
Commit
5f9f052e
authored
6 years ago
by
Nicolas KAROLAK
Browse files
Options
Downloads
Patches
Plain Diff
put nscd restart in try except
parent
89c166b2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
set_app_domain.py
+2
-6
2 additions, 6 deletions
set_app_domain.py
with
2 additions
and
6 deletions
set_app_domain.py
+
2
−
6
View file @
5f9f052e
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
'''
'''
Script to set the domain of an existing MediaServer, Miris Manager or Monitor
Script to set the domain of an existing MediaServer, Miris Manager or Monitor
'''
'''
import
apt
import
os
import
os
import
re
import
re
import
subprocess
import
subprocess
...
@@ -163,13 +162,10 @@ class SetAppDomain():
...
@@ -163,13 +162,10 @@ class SetAppDomain():
with
open
(
'
/etc/hosts
'
,
'
w
'
)
as
fo
:
with
open
(
'
/etc/hosts
'
,
'
w
'
)
as
fo
:
fo
.
write
(
new_hosts
)
fo
.
write
(
new_hosts
)
log
(
'
The
"
/etc/hosts
"
file has been update.
'
)
log
(
'
The
"
/etc/hosts
"
file has been update.
'
)
cache
=
apt
.
Cache
()
cache
.
open
()
try
:
try
:
cache
[
'
nscd
'
].
is_installed
utils
.
run_commands
([
'
service nscd restart
'
])
utils
.
run_commands
([
'
service nscd restart
'
])
except
KeyErro
r
:
except
Exception
as
nscd_er
r
:
pass
log
(
nscd_err
)
else
:
else
:
log
(
'
The
"
/etc/hosts
"
file is already up to date.
'
)
log
(
'
The
"
/etc/hosts
"
file is already up to date.
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment