Skip to content

Commit 1aa55bb

Browse files
committed
Salt Shaker: use capabilities to install proper Python flavor
1 parent 5fdb1b3 commit 1aa55bb

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

Diff for: salt/salt_testenv/salt_classic_package.sls

+14-12
Original file line numberDiff line numberDiff line change
@@ -90,41 +90,43 @@ salt_testing_repo:
9090

9191
{% set salt_minion_is_installed = salt["pkg.info_installed"]("salt-minion").get("salt-minion", False) %}
9292

93-
{% if grains['os_family'] == 'Suse' and grains['osfullname'] in ['SL-Micro', 'openSUSE Tumbleweed'] %}
94-
{% set salt_classic_pkgs = "python3{{ grains['pythonversion'][1] }}-salt-testsuite python3{{ grains['pythonversion'][1] }}-salt" %}
95-
{% set salt_test_executor = "python3{{ grains['pythonversion'][1] }}-salt-test" %}
96-
{% else %}
97-
{% set salt_classic_pkgs = "python3-salt-testsuite python3-salt" %}
98-
{% set salt_test_executor = "python3-salt-test" %}
99-
{% endif %}
93+
salt_version_testing_repo:
94+
cmd.run:
95+
- name: zypper search -x -t package -s --repo salt_testing_repo salt | grep "| salt |" | cut -d"|" -f4 | tr -d ' ' > /tmp/salt_version_testing_repo
96+
- require:
97+
- pkgrepo: salt_testing_repo
10098

10199
install_salt_testsuite:
102100
{% if grains['os_family'] == 'Suse' and grains['osfullname'] == 'SL-Micro' %}
103101
cmd.run:
104-
- name: transactional-update -c -n pkg in {{ salt_classic_pkgs }} {{ salt_test_executor }}
102+
- name: |
103+
SALT_VERSION=`cat /tmp/salt_version_testing_repo`
104+
transactional-update -c -n pkg in --capability python3-salt-testsuite-$SALT_VERSION python3-salt-test python3-salt-$SALT_VERSION
105105
{% else %}
106106
{# HACK: we call zypper manually to ensure right packages are installed regardless upgrade/downgrade #}
107107
cmd.run:
108108
{# We install docker first to ensure zypper does not resolve this dependency to podman-docker #}
109109
{% if salt_minion_is_installed %}
110110
- name: |
111111
zypper --non-interactive in --force docker
112-
zypper --non-interactive in --force --from salt_testing_repo {{ salt_classic_pkgs }} salt salt-minion
112+
SALT_VERSION=`cat /tmp/salt_version_testing_repo`
113+
zypper --non-interactive in --capability --from salt_testing_repo python3-salt-$SALT_VERSION salt-$SALT_VERSION python3-salt-testsuite-$SALT_VERSION salt-minion-$SALT_VERSION
113114
{% else %}
114115
- name: |
115116
zypper --non-interactive in --force docker
116-
zypper --non-interactive in --force --from salt_testing_repo {{ salt_classic_pkgs }} salt
117+
SALT_VERSION=`cat /tmp/salt_version_testing_repo`
118+
zypper --non-interactive in --capability --from salt_testing_repo python3-salt-$SALT_VERSION salt-$SALT_VERSION python3-salt-testsuite-$SALT_VERSION
117119
{% endif %}
118-
- fromrepo: salt_testing_repo
119120
{% endif %}
120121
- require:
121122
- pkgrepo: salt_testsuite_dependencies_repo
122123
- pkgrepo: salt_testing_repo
124+
- cmd: salt_version_testing_repo
123125

124126
install_salt_tests_executor:
125127
{% if grains['os_family'] == 'Suse' and grains['osfullname'] == 'SL-Micro' %}
126128
cmd.run:
127-
- name: transactional-update -c -n pkg in {{ salt_test_executor }}
129+
- name: transactional-update -c -n pkg in python3-salt-test
128130
{% else %}
129131
pkg.installed:
130132
- pkgs:

0 commit comments

Comments
 (0)