Commit 4ba8b9ca authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Use splitlines(), minor modifs of syntax

parent df9504cb
...@@ -981,13 +981,13 @@ class Containerize(): ...@@ -981,13 +981,13 @@ class Containerize():
logging.warning(f'service name given, but will stop all services in ci-docker-compose.yml!') logging.warning(f'service name given, but will stop all services in ci-docker-compose.yml!')
svcName = '' svcName = ''
mySSH.run(f'docker-compose -f {yamlDir}/ci-docker-compose.yml config --services') ret = mySSH.run(f'docker-compose -f {yamlDir}/ci-docker-compose.yml config --services')
# first line has command, last line has next command prompt # first line has command, last line has next command prompt
allServices = mySSH.getBefore().split('\n')[:] allServices = ret.stdout.splitlines()[:]
services = [] services = []
for s in allServices: for s in allServices:
mySSH.run(f'docker-compose -f {yamlDir}/ci-docker-compose.yml ps --all -- {s}') ret = mySSH.run(f'docker-compose -f {yamlDir}/ci-docker-compose.yml ps --all -- {s}')
running = mySSH.getBefore().split('\r\n')[:] running = ret.stdout.splitlines()[:]
logging.debug(f'running services: {running}') logging.debug(f'running services: {running}')
if len(running) > 0: # something is running for that service if len(running) > 0: # something is running for that service
services.append(s) services.append(s)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment