Skip to content

Commit

Permalink
adds exception handling for 143 return code
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Apr 1, 2023
1 parent c3dd46a commit c0a6d81
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion profiwiki/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@author: wf
'''
from mwdocker.docker import DockerContainer
from python_on_whales import DockerException
import tempfile

class ProfiWikiContainer():
Expand Down Expand Up @@ -83,5 +84,9 @@ def install_fontawesome(self):
# make executable
self.dc.container.execute(["chmod","+x",script_path])
self.dc.container.execute([script_path],tty=True)
self.dc.container.execute(["service","apache2","restart"])
try:
self.dc.container.execute(["service","apache2","restart"])
except DockerException as e:
if not e.return_code==143:
raise e
pass

0 comments on commit c0a6d81

Please sign in to comment.