From 8d82df56ff220ea04ffe282cb36c2b15722f3e63 Mon Sep 17 00:00:00 2001 From: The Magician Date: Mon, 20 May 2019 11:44:15 -0700 Subject: [PATCH] Bug fixes for GCP modules (#55974) --- .../cloud/google/gcp_compute_health_check_facts.py | 6 +++--- .../cloud/google/gcp_compute_http_health_check_facts.py | 6 +++--- .../cloud/google/gcp_compute_https_health_check_facts.py | 6 +++--- .../modules/cloud/google/gcp_compute_image_facts.py | 6 +++--- .../modules/cloud/google/gcp_compute_instance_facts.py | 6 +++--- .../cloud/google/gcp_compute_instance_group_facts.py | 6 +++--- .../google/gcp_compute_instance_group_manager_facts.py | 6 +++--- .../cloud/google/gcp_compute_instance_template_facts.py | 6 +++--- .../cloud/google/gcp_compute_interconnect_attachment.py | 6 ++++-- .../google/gcp_compute_interconnect_attachment_facts.py | 9 +++++---- .../modules/cloud/google/gcp_compute_network_facts.py | 6 +++--- .../cloud/google/gcp_compute_region_disk_facts.py | 6 +++--- .../modules/cloud/google/gcp_compute_route_facts.py | 6 +++--- .../targets/gcp_compute_http_health_check/tasks/main.yml | 4 ++-- .../gcp_compute_https_health_check/tasks/main.yml | 4 ++-- .../integration/targets/gcp_compute_image/tasks/main.yml | 4 ++-- .../targets/gcp_compute_instance/tasks/main.yml | 4 ++-- .../targets/gcp_compute_instance_group/tasks/main.yml | 4 ++-- .../gcp_compute_instance_group_manager/tasks/main.yml | 4 ++-- .../targets/gcp_compute_instance_template/tasks/main.yml | 4 ++-- .../targets/gcp_compute_network/tasks/main.yml | 4 ++-- .../targets/gcp_compute_region_disk/tasks/main.yml | 4 ++-- .../integration/targets/gcp_compute_route/tasks/main.yml | 4 ++-- 23 files changed, 62 insertions(+), 59 deletions(-) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_health_check_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_health_check_facts.py index fd621700232..10f3e54448d 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_health_check_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_health_check_facts.py @@ -60,8 +60,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -313,7 +313,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_http_health_check_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_http_health_check_facts.py index a1c4fe54127..47f0c9659e8 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_http_health_check_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_http_health_check_facts.py @@ -60,8 +60,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -159,7 +159,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_https_health_check_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_https_health_check_facts.py index 99ca9a721ef..ef8bec61e0f 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_https_health_check_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_https_health_check_facts.py @@ -60,8 +60,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -159,7 +159,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_image_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_image_facts.py index e6f19b09e26..e471494e4f5 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_image_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_image_facts.py @@ -60,8 +60,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -301,7 +301,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_instance_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_facts.py index 950d95a4883..aa45de39428 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_instance_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_facts.py @@ -65,8 +65,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -494,7 +494,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_instance_group_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_group_facts.py index 890758f2d38..e698b7c2cb7 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_instance_group_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_group_facts.py @@ -65,8 +65,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -167,7 +167,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_instance_group_manager_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager_facts.py index 4f0d703ce1f..bdc3dc0959f 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager_facts.py @@ -65,8 +65,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -242,7 +242,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_instance_template_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_template_facts.py index 612027490f2..a6fd9c2c220 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_instance_template_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_template_facts.py @@ -60,8 +60,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -483,7 +483,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_interconnect_attachment.py b/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment.py index b977a7a9c7d..4c7d6983294 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment.py @@ -108,7 +108,8 @@ options: required: false vlan_tag8021q: description: - - The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. + - The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. When using + PARTNER type this will be managed upstream. required: false region: description: @@ -249,7 +250,8 @@ candidateSubnets: type: list vlanTag8021q: description: - - The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. + - The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. When using + PARTNER type this will be managed upstream. returned: success type: int region: diff --git a/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment_facts.py index b374f4f0e86..5a8b78fe3dc 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment_facts.py @@ -65,8 +65,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -189,7 +189,8 @@ items: type: list vlanTag8021q: description: - - The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. + - The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. When using + PARTNER type this will be managed upstream. returned: success type: int region: @@ -221,7 +222,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_network_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_network_facts.py index 3be15790b2a..e721bc7fa49 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_network_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_network_facts.py @@ -60,8 +60,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -162,7 +162,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_region_disk_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_region_disk_facts.py index 4ce0dfe5b80..09074856311 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_region_disk_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_region_disk_facts.py @@ -65,8 +65,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -247,7 +247,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_route_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_route_facts.py index 9e3fc2bb19b..f57360394fe 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_route_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_route_facts.py @@ -60,8 +60,8 @@ EXAMPLES = ''' ''' RETURN = ''' -items: - description: List of items +resources: + description: List of resources returned: always type: complex contains: @@ -162,7 +162,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_http_health_check/tasks/main.yml b/test/integration/targets/gcp_compute_http_health_check/tasks/main.yml index 9d424e3ff0c..2dd40b2ef29 100644 --- a/test/integration/targets/gcp_compute_http_health_check/tasks/main.yml +++ b/test/integration/targets/gcp_compute_http_health_check/tasks/main.yml @@ -55,7 +55,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a http health check that already exists gcp_compute_http_health_check: @@ -105,7 +105,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a http health check that does not exist gcp_compute_http_health_check: diff --git a/test/integration/targets/gcp_compute_https_health_check/tasks/main.yml b/test/integration/targets/gcp_compute_https_health_check/tasks/main.yml index ca205e01b2d..a55de21107c 100644 --- a/test/integration/targets/gcp_compute_https_health_check/tasks/main.yml +++ b/test/integration/targets/gcp_compute_https_health_check/tasks/main.yml @@ -55,7 +55,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a https health check that already exists gcp_compute_https_health_check: @@ -105,7 +105,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a https health check that does not exist gcp_compute_https_health_check: diff --git a/test/integration/targets/gcp_compute_image/tasks/main.yml b/test/integration/targets/gcp_compute_image/tasks/main.yml index fae58eac1d2..8b0dd41e657 100644 --- a/test/integration/targets/gcp_compute_image/tasks/main.yml +++ b/test/integration/targets/gcp_compute_image/tasks/main.yml @@ -58,7 +58,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a image that already exists gcp_compute_image: @@ -102,7 +102,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a image that does not exist gcp_compute_image: diff --git a/test/integration/targets/gcp_compute_instance/tasks/main.yml b/test/integration/targets/gcp_compute_instance/tasks/main.yml index 1bb8d670d28..140f26f1bf6 100644 --- a/test/integration/targets/gcp_compute_instance/tasks/main.yml +++ b/test/integration/targets/gcp_compute_instance/tasks/main.yml @@ -106,7 +106,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a instance that already exists gcp_compute_instance: @@ -179,7 +179,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a instance that does not exist gcp_compute_instance: diff --git a/test/integration/targets/gcp_compute_instance_group/tasks/main.yml b/test/integration/targets/gcp_compute_instance_group/tasks/main.yml index 51d404dabf1..cab05f1911b 100644 --- a/test/integration/targets/gcp_compute_instance_group/tasks/main.yml +++ b/test/integration/targets/gcp_compute_instance_group/tasks/main.yml @@ -66,7 +66,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a instance group that already exists gcp_compute_instance_group: @@ -119,7 +119,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a instance group that does not exist gcp_compute_instance_group: diff --git a/test/integration/targets/gcp_compute_instance_group_manager/tasks/main.yml b/test/integration/targets/gcp_compute_instance_group_manager/tasks/main.yml index 616344f6214..da438845ef7 100644 --- a/test/integration/targets/gcp_compute_instance_group_manager/tasks/main.yml +++ b/test/integration/targets/gcp_compute_instance_group_manager/tasks/main.yml @@ -94,7 +94,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a instance group manager that already exists gcp_compute_instance_group_manager: @@ -145,7 +145,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a instance group manager that does not exist gcp_compute_instance_group_manager: diff --git a/test/integration/targets/gcp_compute_instance_template/tasks/main.yml b/test/integration/targets/gcp_compute_instance_template/tasks/main.yml index 772baab1f8b..9482b0efd15 100644 --- a/test/integration/targets/gcp_compute_instance_template/tasks/main.yml +++ b/test/integration/targets/gcp_compute_instance_template/tasks/main.yml @@ -90,7 +90,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a instance template that already exists gcp_compute_instance_template: @@ -158,7 +158,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a instance template that does not exist gcp_compute_instance_template: diff --git a/test/integration/targets/gcp_compute_network/tasks/main.yml b/test/integration/targets/gcp_compute_network/tasks/main.yml index aedbf990f35..d8cb927a7d6 100644 --- a/test/integration/targets/gcp_compute_network/tasks/main.yml +++ b/test/integration/targets/gcp_compute_network/tasks/main.yml @@ -49,7 +49,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a network that already exists gcp_compute_network: @@ -93,7 +93,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a network that does not exist gcp_compute_network: diff --git a/test/integration/targets/gcp_compute_region_disk/tasks/main.yml b/test/integration/targets/gcp_compute_region_disk/tasks/main.yml index f693bbe8442..e18f12404e5 100644 --- a/test/integration/targets/gcp_compute_region_disk/tasks/main.yml +++ b/test/integration/targets/gcp_compute_region_disk/tasks/main.yml @@ -62,7 +62,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a region disk that already exists gcp_compute_region_disk: @@ -119,7 +119,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a region disk that does not exist gcp_compute_region_disk: diff --git a/test/integration/targets/gcp_compute_route/tasks/main.yml b/test/integration/targets/gcp_compute_route/tasks/main.yml index 1a657f02578..1b9b28b002c 100644 --- a/test/integration/targets/gcp_compute_route/tasks/main.yml +++ b/test/integration/targets/gcp_compute_route/tasks/main.yml @@ -67,7 +67,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 1 + - results['resources'] | length == 1 # ---------------------------------------------------------------------------- - name: create a route that already exists gcp_compute_route: @@ -121,7 +121,7 @@ - name: verify that command succeeded assert: that: - - results['items'] | length == 0 + - results['resources'] | length == 0 # ---------------------------------------------------------------------------- - name: delete a route that does not exist gcp_compute_route: