Skip to content

Commit 7c4afed

Browse files
committed
Apply feedback
* Expect container to be removed when stopped * Do not remove container image * Rename task file to remove_candlepin_container.yml * Use argv with command module
1 parent 025dd72 commit 7c4afed

7 files changed

Lines changed: 30 additions & 43 deletions

tests/tasks/cleanup_candlepin_container.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SPDX-License-Identifier: MIT
2+
---
3+
- name: Check if the candlepin container exists
4+
command:
5+
argv:
6+
- podman
7+
- ps
8+
- -a
9+
- --filter
10+
- name=candlepin
11+
register: __rhc_candlepin_cont_exists
12+
failed_when: false
13+
changed_when: false
14+
15+
- name: Stop and remove Candlepin container
16+
command:
17+
argv:
18+
- podman
19+
- stop
20+
- candlepin
21+
changed_when: true
22+
when:
23+
- lsr_rhc_test_data_file | length == 0
24+
- '"candlepin" in __rhc_candlepin_cont_exists.stdout'

tests/tasks/setup_candlepin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
use: "{{ __rhc_is_ostree |
3737
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
3838

39-
- name: Stop and remove Candlepin container
40-
include_tasks: cleanup_candlepin_container.yml
39+
- name: Remove Candlepin container
40+
include_tasks: remove_candlepin_container.yml
4141

4242
- name: Start Candlepin container
4343
vars:

tests/tests_environments.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,6 @@
109109
rhc_state: absent
110110
always:
111111
- name: Clean up Candlepin container
112-
include_tasks: tasks/cleanup_candlepin_container.yml
112+
include_tasks: tasks/remove_candlepin_container.yml
113113
vars:
114114
__rhc_cleanup_image: true

tests/tests_proxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@
357357
rhc_state: absent
358358

359359
- name: Clean up Candlepin container
360-
include_tasks: tasks/cleanup_candlepin_container.yml
360+
include_tasks: tasks/remove_candlepin_container.yml
361361
vars:
362362
__rhc_cleanup_image: true
363363

tests/tests_register_unregister.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,6 @@
190190
rhc_state: absent
191191

192192
- name: Clean up Candlepin container
193-
include_tasks: tasks/cleanup_candlepin_container.yml
193+
include_tasks: tasks/remove_candlepin_container.yml
194194
vars:
195195
__rhc_cleanup_image: true

tests/tests_repositories.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@
102102
rhc_state: absent
103103

104104
- name: Clean up Candlepin container
105-
include_tasks: tasks/cleanup_candlepin_container.yml
105+
include_tasks: tasks/remove_candlepin_container.yml
106106
vars:
107107
__rhc_cleanup_image: true

0 commit comments

Comments
 (0)