From 30899b83683242e2346cbab4413409d1ea49ea5e Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Fri, 15 Jul 2016 11:19:49 -0400 Subject: [PATCH] Fix handler case where no old process is found In cases where no old process was found, the shell command was exiting 1 and causing the handler to report a failure. Change-Id: Ic1701f7495abdec713c05d2c95bfdd1e7b1ff73d Closes-Bug: #1603136 --- handlers/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/handlers/main.yml b/handlers/main.yml index 3bacc48b..8547259b 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -33,7 +33,9 @@ - name: Run ns-metadata-proxy process cleanup shell: | for ns_pid in $(pgrep neutron-ns-meta); do - (echo $(readlink -f "/proc/$ns_pid/exe") | grep -qv "{{ neutron_venv_tag }}") && \ + echo $(readlink -f "/proc/$ns_pid/exe") | grep -qv "{{ neutron_venv_tag }}" + if [ $? -eq 0 ]; then (echo "old metadata proxy pid found running clean up on $ns_pid"; kill -9 "$ns_pid") + fi done when: neutron_services['neutron-metadata-agent'].service_en | bool