GetDeployedServices(): return container ID
will be relevant to get the return code in the next commit.
This commit is contained in:
@@ -186,7 +186,7 @@ def GetDeployedServices(ssh, file):
|
|||||||
else:
|
else:
|
||||||
c = ret.stdout
|
c = ret.stdout
|
||||||
logging.info(f'service {s} with container id {c}')
|
logging.info(f'service {s} with container id {c}')
|
||||||
deployed_services.append(s)
|
deployed_services.append((s, c))
|
||||||
return deployed_services
|
return deployed_services
|
||||||
|
|
||||||
def CheckLogs(self, filename, HTML, RAN):
|
def CheckLogs(self, filename, HTML, RAN):
|
||||||
@@ -790,7 +790,7 @@ class Containerize():
|
|||||||
wd_yaml = f'{wd}/docker-compose.y*ml'
|
wd_yaml = f'{wd}/docker-compose.y*ml'
|
||||||
with cls_cmd.getConnection(node) as ssh:
|
with cls_cmd.getConnection(node) as ssh:
|
||||||
ExistEnvFilePrint(ssh, wd)
|
ExistEnvFilePrint(ssh, wd)
|
||||||
services = GetDeployedServices(ssh, wd_yaml)
|
services = [s for s, _ in GetDeployedServices(ssh, wd_yaml)]
|
||||||
success = []
|
success = []
|
||||||
fail = []
|
fail = []
|
||||||
for s in reqServices:
|
for s in reqServices:
|
||||||
@@ -820,7 +820,7 @@ class Containerize():
|
|||||||
copyin_res = None
|
copyin_res = None
|
||||||
ssh.run(f'docker compose -f {wd_yaml} stop')
|
ssh.run(f'docker compose -f {wd_yaml} stop')
|
||||||
if services is not None:
|
if services is not None:
|
||||||
copyin_res = [CopyinServiceLog(ssh, lSourcePath, s, wd_yaml, ctx) for s in services]
|
copyin_res = [CopyinServiceLog(ssh, lSourcePath, s, wd_yaml, ctx) for s, _ in services]
|
||||||
else:
|
else:
|
||||||
logging.warning('could not identify services to stop => no log file')
|
logging.warning('could not identify services to stop => no log file')
|
||||||
ssh.run(f'docker compose -f {wd_yaml} down -v')
|
ssh.run(f'docker compose -f {wd_yaml} down -v')
|
||||||
|
|||||||
Reference in New Issue
Block a user