Skip to content

Commit f8fd100

Browse files
authored
Merge pull request #25 from stackhpc/rpm-distribution-fixes
Sync some fixes from deb distribution work to RPM
2 parents e115543 + f88c682 commit f8fd100

File tree

1 file changed

+5
-4
lines changed
  • roles/pulp_distribution/tasks

1 file changed

+5
-4
lines changed

roles/pulp_distribution/tasks/rpm.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,19 @@
3333
# If another distribution is being promoted to this one:
3434
promoted_dist: "{{ pulp_dists_list.distributions | selectattr('name', 'equalto', item.distribution | default) }}"
3535
promoted_pub: "{{ pulp_pubs_list.publications | selectattr('pulp_href', 'equalto', (promoted_dist | first).publication | default) }}"
36-
# Pick the right pubication based on the type of distribution.
37-
pub: "{{ specific_pub | first if item.version is defined else promoted_pub | first if item.distribution is defined else latest_pub | first }}"
36+
# Pick the right publication based on the type of distribution.
37+
pubs: "{{ specific_pub if item.version is defined else promoted_pub if item.distribution is defined else latest_pub }}"
3838
# Whether any distributions exist for this publication.
39-
pub_has_dists: "{{ pulp_dists_list.distributions | selectattr('publication', 'equalto', pub.pulp_href) | list | length > 0 }}"
39+
pub_has_dists: >-
40+
{{ pulp_dists_list.distributions | selectattr('publication', 'equalto', pubs[0].pulp_href if item.state == 'present' else None) | list | length > 0 }}
4041
pulp.squeezer.rpm_distribution:
4142
pulp_url: "{{ pulp_url }}"
4243
username: "{{ pulp_username }}"
4344
password: "{{ pulp_password }}"
4445
validate_certs: "{{ pulp_validate_certs | bool }}"
4546
name: "{{ item.name }}"
4647
base_path: "{{ item.base_path }}"
47-
publication: "{{ pub.pulp_href if item.state == 'present' else omit }}"
48+
publication: "{{ pubs[0].pulp_href if item.state == 'present' else omit }}"
4849
state: "{{ item.state }}"
4950
with_items: "{{ pulp_distribution_rpm }}"
5051
when: >-

0 commit comments

Comments
 (0)