Fix comment lines (#) are not ignored in docker startup bash script

This commit is contained in:
allegroai 2024-03-17 18:58:14 +02:00
parent f1f9278928
commit 8a2bea3c14

View File

@ -4279,7 +4279,8 @@ class Worker(ServiceCommandSection):
if docker_bash_setup_script and docker_bash_setup_script.strip('\n '):
extra_shell_script = (extra_shell_script or '') + \
' ; '.join(line.strip()
for line in docker_bash_setup_script.split('\n') if line.strip()) + \
for line in docker_bash_setup_script.split('\n')
if line.strip() and not line.lstrip().startswith("#")) + \
' ; '
self.debug(