From 1a3a0fdbf5fc4f573e4cd573f31131b0f3d86064 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: Ie83262629060866dd0d208ed41704aef21416aa0 --- handlers/main.yml | 4 ++-- tasks/neutron_install.yml | 4 ++-- tasks/neutron_install_source.yml | 14 +++++++------- tasks/neutron_selinux.yml | 2 +- tasks/providers/calico_config.yml | 4 ++-- tasks/providers/dragonflow_config.yml | 2 +- tasks/providers/opendaylight_config.yml | 2 +- tests/test-neutron-resources-upgrade.yml | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 597ea950..26ea8b4f 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -21,7 +21,7 @@ daemon_reload: yes with_items: "{{ filtered_neutron_services }}" register: _stop - until: _stop | success + until: _stop is success retries: 5 delay: 2 listen: "Restart neutron services" @@ -82,7 +82,7 @@ daemon_reload: yes with_items: "{{ filtered_neutron_services }}" register: _start - until: _start | success + until: _start is success retries: 5 delay: 2 listen: "Restart neutron services" diff --git a/tasks/neutron_install.yml b/tasks/neutron_install.yml index 01d47d21..fd8e0659 100644 --- a/tasks/neutron_install.yml +++ b/tasks/neutron_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 @@ -41,7 +41,7 @@ name: "{{ item }}" state: absent register: remove_packages - until: remove_packages|success + until: remove_packages is success retries: 5 delay: 2 with_items: "{{ neutron_remove_distro_packages }}" diff --git a/tasks/neutron_install_source.yml b/tasks/neutron_install_source.yml index ccd031e1..826385d2 100644 --- a/tasks/neutron_install_source.yml +++ b/tasks/neutron_install_source.yml @@ -41,21 +41,21 @@ file: path: "{{ neutron_bin | dirname }}" state: absent - when: neutron_get_venv | changed + when: neutron_get_venv is changed - name: Create neutron venv dir file: path: "{{ neutron_bin | dirname }}" state: directory register: neutron_venv_dir - when: neutron_get_venv | changed + when: neutron_get_venv is changed - name: Unarchive pre-built venv unarchive: src: "/var/cache/{{ neutron_venv_download_url | basename }}" dest: "{{ neutron_bin | dirname }}" copy: "no" - when: neutron_get_venv | changed + when: neutron_get_venv is changed notify: Restart neutron services - name: Install pip packages @@ -69,7 +69,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: neutron_get_venv | failed or neutron_get_venv | skipped @@ -81,7 +81,7 @@ state: "absent" when: - ansible_pkg_mgr in ['yum', 'dnf', 'zypper'] - - neutron_get_venv | changed + - neutron_get_venv is changed # NOTE(odyssey4me): # We reinitialize the venv to ensure that the right @@ -99,7 +99,7 @@ --no-pip \ --no-setuptools \ --no-wheel - when: neutron_get_venv | changed + when: neutron_get_venv is changed tags: - skip_ansible_lint @@ -124,7 +124,7 @@ neutron_lbaasv2 | bool or neutron_vpnaas | bool register: install_optional_packages - until: install_optional_packages | success + until: install_optional_packages is success retries: 5 delay: 2 notify: Restart neutron services diff --git a/tasks/neutron_selinux.yml b/tasks/neutron_selinux.yml index daf05615..e9a5c3f4 100644 --- a/tasks/neutron_selinux.yml +++ b/tasks/neutron_selinux.yml @@ -72,4 +72,4 @@ - name: Apply updated SELinux contexts on neutron log directory command: "restorecon -Rv {{ (neutron_log_dir_check.stat.islnk) | ternary(neutron_log_dir_check.stat.lnk_target, neutron_log_dir) }}" when: - - selinux_file_context_log_files | changed + - selinux_file_context_log_files is changed diff --git a/tasks/providers/calico_config.yml b/tasks/providers/calico_config.yml index a6d397da..95cea862 100644 --- a/tasks/providers/calico_config.yml +++ b/tasks/providers/calico_config.yml @@ -24,7 +24,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: @@ -44,7 +44,7 @@ validate_certs: "{{ calico_felix_validate_certs }}" mode: '0755' register: install_packages - until: install_packages|success + until: install_packages is success retries: 5 delay: 2 when: diff --git a/tasks/providers/dragonflow_config.yml b/tasks/providers/dragonflow_config.yml index d14eeff5..f081f0dd 100644 --- a/tasks/providers/dragonflow_config.yml +++ b/tasks/providers/dragonflow_config.yml @@ -24,7 +24,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 notify: Restart neutron services diff --git a/tasks/providers/opendaylight_config.yml b/tasks/providers/opendaylight_config.yml index fb5faec6..3e6be0da 100644 --- a/tasks/providers/opendaylight_config.yml +++ b/tasks/providers/opendaylight_config.yml @@ -33,7 +33,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 tags: diff --git a/tests/test-neutron-resources-upgrade.yml b/tests/test-neutron-resources-upgrade.yml index 6b340a51..2ba3f7c6 100644 --- a/tests/test-neutron-resources-upgrade.yml +++ b/tests/test-neutron-resources-upgrade.yml @@ -37,7 +37,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