From d4b29e78386247affb4aaeb5367f57fa6ba8b70f Mon Sep 17 00:00:00 2001 From: The Magician Date: Mon, 20 May 2019 11:43:58 -0700 Subject: [PATCH] Bug fixes for GCP modules (#55975) --- .../modules/cloud/google/gcp_compute_router_facts.py | 6 +++--- .../cloud/google/gcp_compute_ssl_certificate_facts.py | 6 +++--- .../modules/cloud/google/gcp_compute_ssl_policy_facts.py | 6 +++--- .../modules/cloud/google/gcp_compute_subnetwork_facts.py | 6 +++--- .../cloud/google/gcp_compute_target_http_proxy_facts.py | 6 +++--- .../cloud/google/gcp_compute_target_https_proxy_facts.py | 6 +++--- .../modules/cloud/google/gcp_compute_target_pool_facts.py | 6 +++--- .../cloud/google/gcp_compute_target_ssl_proxy_facts.py | 6 +++--- .../cloud/google/gcp_compute_target_tcp_proxy_facts.py | 6 +++--- .../cloud/google/gcp_compute_target_vpn_gateway_facts.py | 6 +++--- .../modules/cloud/google/gcp_compute_url_map_facts.py | 6 +++--- test/integration/targets/gcp_compute_router/tasks/main.yml | 4 ++-- .../targets/gcp_compute_ssl_certificate/tasks/main.yml | 4 ++-- .../targets/gcp_compute_ssl_policy/tasks/main.yml | 4 ++-- .../targets/gcp_compute_subnetwork/tasks/main.yml | 4 ++-- .../targets/gcp_compute_target_http_proxy/tasks/main.yml | 4 ++-- .../targets/gcp_compute_target_https_proxy/tasks/main.yml | 4 ++-- .../targets/gcp_compute_target_pool/tasks/main.yml | 4 ++-- .../targets/gcp_compute_target_ssl_proxy/tasks/main.yml | 4 ++-- .../targets/gcp_compute_target_tcp_proxy/tasks/main.yml | 4 ++-- .../targets/gcp_compute_target_vpn_gateway/tasks/main.yml | 4 ++-- test/integration/targets/gcp_compute_url_map/tasks/main.yml | 4 ++-- .../targets/gcp_compute_vpn_tunnel/tasks/main.yml | 4 ++-- 23 files changed, 57 insertions(+), 57 deletions(-) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_router_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_router_facts.py index fd454ea5bd5..c43d79e379a 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_router_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_router_facts.py @@ -65,8 +65,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -177,7 +177,7 @@ def main(): items = items.get('items') else: items = [] - return_value = {'items': items} + return_value = {'resources': items} module.exit_json(**return_value) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate_facts.py index 12c1704e366..b09b5fb21ce 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate_facts.py @@ -60,8 +60,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -126,7 +126,7 @@ def main(): items = items.get('items') else: items = [] - return_value = {'items': items} + return_value = {'resources': items} module.exit_json(**return_value) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy_facts.py index 22758a32d56..042b6e1577f 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy_facts.py @@ -60,8 +60,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -164,7 +164,7 @@ def main(): items = items.get('items') else: items = [] - return_value = {'items': items} + return_value = {'resources': items} module.exit_json(**return_value) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_subnetwork_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_subnetwork_facts.py index 58d67c35ccd..ed105b8675c 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_subnetwork_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_subnetwork_facts.py @@ -65,8 +65,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -186,7 +186,7 @@ def main(): items = items.get('items') else: items = [] - return_value = {'items': items} + return_value = {'resources': items} module.exit_json(**return_value) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_facts.py index 0ae4f891c64..3d2b4334f65 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_facts.py @@ -60,8 +60,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -120,7 +120,7 @@ def main(): items = items.get('items') else: items = [] - return_value = {'items': items} + return_value = {'resources': items} module.exit_json(**return_value) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py index 423fe90e879..959a3708511 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py @@ -60,8 +60,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -143,7 +143,7 @@ def main(): items = items.get('items') else: items = [] - return_value = {'items': items} + return_value = {'resources': items} module.exit_json(**return_value) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_pool_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_pool_facts.py index 884cc6dcf09..09dec5fbdeb 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_pool_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_pool_facts.py @@ -65,8 +65,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -178,7 +178,7 @@ def main(): items = items.get('items') else: items = [] - return_value = {'items': items} + return_value = {'resources': items} module.exit_json(**return_value) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy_facts.py index a1937543072..6a1b9d26a41 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy_facts.py @@ -60,8 +60,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -139,7 +139,7 @@ def main(): items = items.get('items') else: items = [] - return_value = {'items': items} + return_value = {'resources': items} module.exit_json(**return_value) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy_facts.py index ab0e0da3008..6b641ee28e3 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy_facts.py @@ -60,8 +60,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -125,7 +125,7 @@ def main(): items = items.get('items') else: items = [] - return_value = {'items': items} + return_value = {'resources': items} module.exit_json(**return_value) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway_facts.py index 91c2a47ac6f..dda73d75c7b 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway_facts.py @@ -65,8 +65,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -140,7 +140,7 @@ def main(): items = items.get('items') else: items = [] - return_value = {'items': items} + return_value = {'resources': items} module.exit_json(**return_value) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_url_map_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_url_map_facts.py index 99ed600a31f..97c6c7daa78 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_url_map_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_url_map_facts.py @@ -60,8 +60,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -221,7 +221,7 @@ def main(): items = items.get('items') else: items = [] - return_value = {'items': items} + return_value = {'resources': items} module.exit_json(**return_value) diff --git a/test/integration/targets/gcp_compute_router/tasks/main.yml b/test/integration/targets/gcp_compute_router/tasks/main.yml index ac9e5f57b0b..2e20dd9e6c7 100644 --- a/test/integration/targets/gcp_compute_router/tasks/main.yml +++ b/test/integration/targets/gcp_compute_router/tasks/main.yml @@ -76,7 +76,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a router that already exists gcp_compute_router: @@ -139,7 +139,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a router that does not exist gcp_compute_router: diff --git a/test/integration/targets/gcp_compute_ssl_certificate/tasks/main.yml b/test/integration/targets/gcp_compute_ssl_certificate/tasks/main.yml index 467b1c418d3..afa697113cc 100644 --- a/test/integration/targets/gcp_compute_ssl_certificate/tasks/main.yml +++ b/test/integration/targets/gcp_compute_ssl_certificate/tasks/main.yml @@ -73,7 +73,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a ssl certificate that already exists gcp_compute_ssl_certificate: @@ -141,7 +141,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a ssl certificate that does not exist gcp_compute_ssl_certificate: diff --git a/test/integration/targets/gcp_compute_ssl_policy/tasks/main.yml b/test/integration/targets/gcp_compute_ssl_policy/tasks/main.yml index 05bd52f6367..01332bb1773 100644 --- a/test/integration/targets/gcp_compute_ssl_policy/tasks/main.yml +++ b/test/integration/targets/gcp_compute_ssl_policy/tasks/main.yml @@ -57,7 +57,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a ssl policy that already exists gcp_compute_ssl_policy: @@ -109,7 +109,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a ssl policy that does not exist gcp_compute_ssl_policy: diff --git a/test/integration/targets/gcp_compute_subnetwork/tasks/main.yml b/test/integration/targets/gcp_compute_subnetwork/tasks/main.yml index ffcca46aea4..587008ba9d1 100644 --- a/test/integration/targets/gcp_compute_subnetwork/tasks/main.yml +++ b/test/integration/targets/gcp_compute_subnetwork/tasks/main.yml @@ -63,7 +63,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a subnetwork that already exists gcp_compute_subnetwork: @@ -112,7 +112,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a subnetwork that does not exist gcp_compute_subnetwork: diff --git a/test/integration/targets/gcp_compute_target_http_proxy/tasks/main.yml b/test/integration/targets/gcp_compute_target_http_proxy/tasks/main.yml index a5182a72249..b4e3327d69c 100644 --- a/test/integration/targets/gcp_compute_target_http_proxy/tasks/main.yml +++ b/test/integration/targets/gcp_compute_target_http_proxy/tasks/main.yml @@ -92,7 +92,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a target http proxy that already exists gcp_compute_target_http_proxy: @@ -136,7 +136,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a target http proxy that does not exist gcp_compute_target_http_proxy: diff --git a/test/integration/targets/gcp_compute_target_https_proxy/tasks/main.yml b/test/integration/targets/gcp_compute_target_https_proxy/tasks/main.yml index 144bf956fa8..d62cacb69cc 100644 --- a/test/integration/targets/gcp_compute_target_https_proxy/tasks/main.yml +++ b/test/integration/targets/gcp_compute_target_https_proxy/tasks/main.yml @@ -117,7 +117,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a target https proxy that already exists gcp_compute_target_https_proxy: @@ -165,7 +165,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a target https proxy that does not exist gcp_compute_target_https_proxy: diff --git a/test/integration/targets/gcp_compute_target_pool/tasks/main.yml b/test/integration/targets/gcp_compute_target_pool/tasks/main.yml index e829539097c..35cc5755b19 100644 --- a/test/integration/targets/gcp_compute_target_pool/tasks/main.yml +++ b/test/integration/targets/gcp_compute_target_pool/tasks/main.yml @@ -50,7 +50,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a target pool that already exists gcp_compute_target_pool: @@ -95,7 +95,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a target pool that does not exist gcp_compute_target_pool: diff --git a/test/integration/targets/gcp_compute_target_ssl_proxy/tasks/main.yml b/test/integration/targets/gcp_compute_target_ssl_proxy/tasks/main.yml index 915789b1697..00215f70f34 100644 --- a/test/integration/targets/gcp_compute_target_ssl_proxy/tasks/main.yml +++ b/test/integration/targets/gcp_compute_target_ssl_proxy/tasks/main.yml @@ -112,7 +112,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a target ssl proxy that already exists gcp_compute_target_ssl_proxy: @@ -160,7 +160,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a target ssl proxy that does not exist gcp_compute_target_ssl_proxy: diff --git a/test/integration/targets/gcp_compute_target_tcp_proxy/tasks/main.yml b/test/integration/targets/gcp_compute_target_tcp_proxy/tasks/main.yml index 0cfb6a319ef..5ad77de1cbc 100644 --- a/test/integration/targets/gcp_compute_target_tcp_proxy/tasks/main.yml +++ b/test/integration/targets/gcp_compute_target_tcp_proxy/tasks/main.yml @@ -89,7 +89,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a target tcp proxy that already exists gcp_compute_target_tcp_proxy: @@ -135,7 +135,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a target tcp proxy that does not exist gcp_compute_target_tcp_proxy: diff --git a/test/integration/targets/gcp_compute_target_vpn_gateway/tasks/main.yml b/test/integration/targets/gcp_compute_target_vpn_gateway/tasks/main.yml index a94f0585e70..2345222120e 100644 --- a/test/integration/targets/gcp_compute_target_vpn_gateway/tasks/main.yml +++ b/test/integration/targets/gcp_compute_target_vpn_gateway/tasks/main.yml @@ -69,7 +69,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a target vpn gateway that already exists gcp_compute_target_vpn_gateway: @@ -116,7 +116,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a target vpn gateway that does not exist gcp_compute_target_vpn_gateway: diff --git a/test/integration/targets/gcp_compute_url_map/tasks/main.yml b/test/integration/targets/gcp_compute_url_map/tasks/main.yml index 5bb2b2ba17e..2361a630314 100644 --- a/test/integration/targets/gcp_compute_url_map/tasks/main.yml +++ b/test/integration/targets/gcp_compute_url_map/tasks/main.yml @@ -83,7 +83,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a url map that already exists gcp_compute_url_map: @@ -127,7 +127,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a url map that does not exist gcp_compute_url_map: diff --git a/test/integration/targets/gcp_compute_vpn_tunnel/tasks/main.yml b/test/integration/targets/gcp_compute_vpn_tunnel/tasks/main.yml index ffa4a266b2d..9e9db557791 100644 --- a/test/integration/targets/gcp_compute_vpn_tunnel/tasks/main.yml +++ b/test/integration/targets/gcp_compute_vpn_tunnel/tasks/main.yml @@ -92,7 +92,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a vpn tunnel that already exists gcp_compute_vpn_tunnel: @@ -143,7 +143,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a vpn tunnel that does not exist gcp_compute_vpn_tunnel: