From 2d924b773dde2b94920ee8fc4b63ddda83d2ede9 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Thu, 12 Jul 2018 16:44:20 +0200 Subject: [PATCH] Fix usage of "|" for tests With the more recent versions of ansible, we should now use "is" instead of the "|" sign for the tests. This should fix it. Change-Id: Ida90a5a717adaf07ebf2ee6f04136fe920cfe46b --- ansible-lint/test/apt-repository-cache-update-failure.yml | 4 ++-- ansible-lint/test/apt-repository-cache-update-success.yml | 2 +- common-tasks/test-force-package-cache-update.yml | 2 +- test-prepare-host.yml | 4 ++-- test-setup-cinder-localhost.yml | 8 ++++---- test-setup-swifthosts.yml | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ansible-lint/test/apt-repository-cache-update-failure.yml b/ansible-lint/test/apt-repository-cache-update-failure.yml index c68474ce..3f5a4d71 100644 --- a/ansible-lint/test/apt-repository-cache-update-failure.yml +++ b/ansible-lint/test/apt-repository-cache-update-failure.yml @@ -13,11 +13,11 @@ apt_repository: repo: "deb https://example.com/foo/ bar baz" register: add_repo - until: add_repo|success + until: add_repo is success - name: APT cache updates explicitly enabled and retries apt_repository: repo: "deb https://example.com/foo/ bar baz" update_cache: true register: add_repo - until: add_repo|success + until: add_repo is success diff --git a/ansible-lint/test/apt-repository-cache-update-success.yml b/ansible-lint/test/apt-repository-cache-update-success.yml index f108f151..0a51bc04 100644 --- a/ansible-lint/test/apt-repository-cache-update-success.yml +++ b/ansible-lint/test/apt-repository-cache-update-success.yml @@ -10,4 +10,4 @@ repo: "deb https://example.com/foo/ bar baz" update_cache: false register: add_repo - until: add_repo|success + until: add_repo is success diff --git a/common-tasks/test-force-package-cache-update.yml b/common-tasks/test-force-package-cache-update.yml index 4b16b4e4..1ee8e9d1 100644 --- a/common-tasks/test-force-package-cache-update.yml +++ b/common-tasks/test-force-package-cache-update.yml @@ -19,7 +19,7 @@ register: _update retries: 5 delay: 2 - until: _update | succeeded + until: _update is succeeded changed_when: false when: - ansible_pkg_mgr == 'apt' diff --git a/test-prepare-host.yml b/test-prepare-host.yml index c8517bde..f4fc1169 100644 --- a/test-prepare-host.yml +++ b/test-prepare-host.yml @@ -193,7 +193,7 @@ command: "ifdown {{ item.name | default('br-mgmt') }}:0" when: - ansible_pkg_mgr in ['yum', 'dnf'] - - network_interfaces_rhel | changed + - network_interfaces_rhel is changed - item.alias is defined with_items: "{{ bridges }}" @@ -208,7 +208,7 @@ command: "ifup {{ item.name | default('br-mgmt') }}:0" when: - ansible_pkg_mgr in ['yum', 'dnf'] - - network_interfaces_rhel | changed + - network_interfaces_rhel is changed - item.alias is defined with_items: "{{ bridges }}" diff --git a/test-setup-cinder-localhost.yml b/test-setup-cinder-localhost.yml index 8664c345..b4078958 100644 --- a/test-setup-cinder-localhost.yml +++ b/test-setup-cinder-localhost.yml @@ -29,16 +29,16 @@ - name: Get a loopback device for cinder file command: losetup -f - when: cinder_create | changed + when: cinder_create is changed register: cinder_losetup - name: Create the loopback device command: "losetup {{ cinder_losetup.stdout }} /openstack/cinder.img" - when: cinder_create | changed + when: cinder_create is changed - name: Make LVM physical volume on the cinder device command: "{{ item }}" - when: cinder_create | changed + when: cinder_create is changed with_items: - "pvcreate {{ cinder_losetup.stdout }}" - "pvscan" @@ -47,5 +47,5 @@ lvg: vg: cinder-volumes pvs: "{{ cinder_losetup.stdout }}" - when: cinder_create | changed + when: cinder_create is changed diff --git a/test-setup-swifthosts.yml b/test-setup-swifthosts.yml index 0ab7a5bd..c28fc49f 100644 --- a/test-setup-swifthosts.yml +++ b/test-setup-swifthosts.yml @@ -70,7 +70,7 @@ fstype: xfs opts: '-K' dev: "/opt/{{ container_name}}_{{ item }}.img" - when: swift_create | changed + when: swift_create is changed with_items: - 'swift1' - 'swift2' @@ -89,7 +89,7 @@ - 'swift1' - 'swift2' register: mount_status - until: mount_status | success + until: mount_status is success retries: 5 delay: 2 delegate_to: "{{ physical_host }}"