fix typo in scheduler and add more logs to swarm tests

This commit is contained in:
florian 2024-03-18 15:30:48 +01:00
parent 35d1564d8a
commit 07140a5e72
No known key found for this signature in database
GPG key ID: 93EE47CC3D061500
2 changed files with 16 additions and 1 deletions

View file

@ -137,7 +137,7 @@ def generate_external_plugins(plugins: List[Dict[str, Any]], *, original_path: U
original_path.mkdir(parents=True, exist_ok=True)
for plugin in plugins:
try:
if not plugin["data"]:
if plugin["data"]:
tmp_path = original_path.joinpath(plugin["id"], f"{plugin['name']}.tar.gz")
tmp_path.parent.mkdir(parents=True, exist_ok=True)
tmp_path.write_bytes(plugin["data"])

View file

@ -171,6 +171,21 @@ class SwarmTest(Test):
sleep(1)
i += 1
if not healthy:
proc = run(
'docker stack services --format "{{ .Name }}" ' + self._name,
cwd="/tmp/swarm",
shell=True,
capture_output=True,
)
for service in proc.stdout.decode().splitlines():
proc2 = run(
'docker service ps ' + service,
cwd="/tmp/swarm",
shell=True,
capture_output=True,
)
log("SWARM", "", f"stdout logs = {proc2.stdout.decode()}")
log("SWARM", "", f"stderr logs = {proc2.stderr.decode()}")
raise (Exception("swarm stack is not healthy"))
except:
log(