Filter only spoc apps in all app status

This commit is contained in:
Disassembler 2021-07-11 16:18:11 +02:00
parent 4420d64c45
commit c3a73f2b28
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
2 changed files with 4 additions and 4 deletions

View File

@ -35,10 +35,10 @@ def stop_pod(app_name):
run(['podman', 'pod', 'stop', '--ignore', app_name])
def get_pod_status(app_name=None):
cmd = ['podman', 'pod', 'ps']
app_filter = 'label=spoc.app'
if app_name:
cmd.extend(['--filter', f'label=spoc.app={app_name}'])
return out(cmd)
app_filter = f'{app_filter}={app_name}'
return out(['podman', 'pod', 'ps', '--filter', app_filter])
def create_volume(app_name, vol_name):
run(['podman', 'volume', 'create', '--label', f'spoc.app={app_name}', vol_name])

View File

@ -73,7 +73,7 @@ def test_get_pod_status_all(out):
out.return_value = 'RESULT'
status = podman.get_pod_status()
expected_cmd = ['podman', 'pod', 'ps']
expected_cmd = ['podman', 'pod', 'ps', '--filter', 'label=spoc.app']
out.assert_called_once_with(expected_cmd)
assert status == 'RESULT'