From bf9a1c19fab27aaedba4b939a36b152bf77a48b4 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Thu, 12 Jul 2018 16:44:21 +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: Ifec8022a02b0a5f259cadf5eb65ab74c51df3e73 --- handlers/main.yml | 4 ++-- tasks/cinder_backends.yml | 2 +- tasks/cinder_db_setup.yml | 2 +- tasks/cinder_install.yml | 2 +- tasks/cinder_install_source.yml | 12 ++++++------ tasks/cinder_selinux.yml | 2 +- tests/test-cinder-resources-upgrade.yml | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 546646dd..afabc040 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -21,7 +21,7 @@ daemon_reload: "{{ (ansible_service_mgr == 'systemd') | ternary('yes', omit) }}" with_items: "{{ filtered_cinder_services }}" register: _stop - until: _stop | success + until: _stop is success retries: 5 delay: 2 listen: Restart cinder services @@ -52,7 +52,7 @@ daemon_reload: "{{ (ansible_service_mgr == 'systemd') | ternary('yes', omit) }}" with_items: "{{ filtered_cinder_services }}" register: _start - until: _start | success + until: _start is success retries: 5 delay: 2 listen: Restart cinder services diff --git a/tasks/cinder_backends.yml b/tasks/cinder_backends.yml index e982b62d..284a4703 100644 --- a/tasks/cinder_backends.yml +++ b/tasks/cinder_backends.yml @@ -19,7 +19,7 @@ status_code: 200,300 validate_certs: "{{ cinder_service_internaluri_insecure | bool }}" register: api_status - until: api_status | success + until: api_status is success retries: 10 delay: 10 diff --git a/tasks/cinder_db_setup.yml b/tasks/cinder_db_setup.yml index 071763c0..2e4eedf2 100644 --- a/tasks/cinder_db_setup.yml +++ b/tasks/cinder_db_setup.yml @@ -63,4 +63,4 @@ value: False when: - not data_migrations | skipped - - data_migrations | succeeded + - data_migrations is succeeded diff --git a/tasks/cinder_install.yml b/tasks/cinder_install.yml index 0edfc5b1..2f942d95 100644 --- a/tasks/cinder_install.yml +++ b/tasks/cinder_install.yml @@ -32,7 +32,7 @@ update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}" cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}" register: install_packages - until: install_packages | success + until: install_packages is success retries: 5 delay: 2 diff --git a/tasks/cinder_install_source.yml b/tasks/cinder_install_source.yml index f232b048..c4ea6542 100644 --- a/tasks/cinder_install_source.yml +++ b/tasks/cinder_install_source.yml @@ -41,21 +41,21 @@ file: path: "{{ cinder_bin | dirname }}" state: absent - when: cinder_get_venv | changed + when: cinder_get_venv is changed - name: Create cinder venv dir file: path: "{{ cinder_bin | dirname }}" state: directory register: cinder_venv_dir - when: cinder_get_venv | changed + when: cinder_get_venv is changed - name: Unarchive pre-built venv unarchive: src: "/var/cache/{{ cinder_venv_download_url | basename }}" dest: "{{ cinder_bin | dirname }}" copy: "no" - when: cinder_get_venv | changed + when: cinder_get_venv is changed notify: - Manage LB - Restart cinder services @@ -71,7 +71,7 @@ {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }} {{ pip_install_options | default('') }} register: install_packages - until: install_packages|success + until: install_packages is success retries: 5 delay: 2 when: cinder_get_venv | failed or cinder_get_venv | skipped @@ -98,7 +98,7 @@ state: "absent" when: - ansible_pkg_mgr in ['yum', 'dnf', 'zypper'] - - cinder_get_venv | changed + - cinder_get_venv is changed # NOTE(odyssey4me): # We reinitialize the venv to ensure that the right @@ -116,7 +116,7 @@ --no-pip \ --no-setuptools \ --no-wheel - when: cinder_get_venv | changed + when: cinder_get_venv is changed tags: - skip_ansible_lint diff --git a/tasks/cinder_selinux.yml b/tasks/cinder_selinux.yml index c6d2589b..cc01a5a1 100644 --- a/tasks/cinder_selinux.yml +++ b/tasks/cinder_selinux.yml @@ -28,4 +28,4 @@ - name: Apply updated SELinux contexts on cinder log directory command: "restorecon -Rv {{ (cinder_log_dir_check.stat.islnk) | ternary(cinder_log_dir_check.stat.lnk_target, cinder_log_dir) }}" when: - - selinux_file_context_log_files | changed + - selinux_file_context_log_files is changed diff --git a/tests/test-cinder-resources-upgrade.yml b/tests/test-cinder-resources-upgrade.yml index 034e0fcd..7a43e6ae 100644 --- a/tests/test-cinder-resources-upgrade.yml +++ b/tests/test-cinder-resources-upgrade.yml @@ -36,7 +36,7 @@ {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }} {{ pip_install_options | default('') }} register: install_packages - until: install_packages | success + until: install_packages is success retries: 5 delay: 2