Linter and CI tasks fixes

Change-Id: I0bcd30fc21de7838094b992cecc3a0e850c4da3a
This commit is contained in:
Sagi Shnaidman
2024-12-17 14:55:59 +02:00
parent e4be201f20
commit f448ac258d
14 changed files with 20 additions and 67 deletions

View File

@@ -42,10 +42,12 @@
register: userinfo
- name: Assert only one result exists
assert:
that: "{{ userinfo.openstack_users | length }} == 1"
that:
- userinfo.openstack_users | length == 1
- name: Assert userinfo has fields
assert:
that: item in userinfo.openstack_users[0]
that:
- item in userinfo.openstack_users[0]
loop: "{{ os_expected_user_info_fields }}"
- block:
@@ -55,7 +57,8 @@
register: userinfo
- name: Assert results were returned
assert:
that: "{{ userinfo.openstack_users | length }} > 0"
that:
- userinfo.openstack_users | length > 0
- name: Post-test cleanup
block:

View File

@@ -108,30 +108,6 @@
state: absent
name: "{{ secgroup_name }}"
- name: Test port binding config (runs from train release sdk > 0.28)
block:
- name: Create port (with binding profile)
openstack.cloud.port:
cloud: "{{ cloud }}"
state: present
name: "{{ port_name }}"
network: "{{ network_name }}"
binding_profile: "{{ binding_profile }}"
register: port
- name: Assert binding:profile exists in created port
assert:
that: "port.port['binding_profile']"
- debug: var=port
- name: Delete port (with binding profile)
openstack.cloud.port:
cloud: "{{ cloud }}"
state: absent
name: "{{ port_name }}"
when: sdk_version is version(0.28, '>')
- name: Delete subnet
openstack.cloud.subnet:
cloud: "{{ cloud }}"

View File

@@ -79,7 +79,7 @@
- name: Check info
assert:
that:
- info1.volumes | selectattr("id", "equalto", "{{ info.volumes.0.id }}") | list | length == 1
- info1.volumes | selectattr("id", "equalto", info.volumes.0.id) | list | length == 1
- info1.volumes.0.name == 'ansible_test'
- info1.volumes.0.status == None