From d88f686976b874b0f409a78e1cb907bc11ff9c81 Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 9 Jul 2019 11:35:04 -0700 Subject: [PATCH] Bug fixes for GCP modules (#58851) --- .../targets/gcp_sourcerepo_repository/tasks/main.yml | 4 ++-- test/integration/targets/gcp_sql_instance/tasks/main.yml | 4 ++-- test/integration/targets/gcp_tpu_node/tasks/main.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/integration/targets/gcp_sourcerepo_repository/tasks/main.yml b/test/integration/targets/gcp_sourcerepo_repository/tasks/main.yml index fe47467f1c0..bfa9540130c 100644 --- a/test/integration/targets/gcp_sourcerepo_repository/tasks/main.yml +++ b/test/integration/targets/gcp_sourcerepo_repository/tasks/main.yml @@ -44,7 +44,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length >= 1 + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 # ---------------------------------------------------------------------------- - name: create a repository that already exists gcp_sourcerepo_repository: @@ -82,7 +82,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length == 0 + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0 # ---------------------------------------------------------------------------- - name: delete a repository that does not exist gcp_sourcerepo_repository: diff --git a/test/integration/targets/gcp_sql_instance/tasks/main.yml b/test/integration/targets/gcp_sql_instance/tasks/main.yml index af75218749b..0bee3e3c82b 100644 --- a/test/integration/targets/gcp_sql_instance/tasks/main.yml +++ b/test/integration/targets/gcp_sql_instance/tasks/main.yml @@ -59,7 +59,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length >= 1 + - results['resources'] | map(attribute='name') | select("match", ".*{{resource_name}}-2.*") | list | length == 1 # ---------------------------------------------------------------------------- - name: create a instance that already exists gcp_sql_instance: @@ -113,7 +113,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length == 0 + - results['resources'] | map(attribute='name') | select("match", ".*{{resource_name}}-2.*") | list | length == 0 # ---------------------------------------------------------------------------- - name: delete a instance that does not exist gcp_sql_instance: diff --git a/test/integration/targets/gcp_tpu_node/tasks/main.yml b/test/integration/targets/gcp_tpu_node/tasks/main.yml index 10c10ee34da..06157f93f12 100644 --- a/test/integration/targets/gcp_tpu_node/tasks/main.yml +++ b/test/integration/targets/gcp_tpu_node/tasks/main.yml @@ -53,7 +53,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length >= 1 + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 # ---------------------------------------------------------------------------- - name: create a node that already exists gcp_tpu_node: @@ -100,7 +100,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length == 0 + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0 # ---------------------------------------------------------------------------- - name: delete a node that does not exist gcp_tpu_node: