Skip to content

Commit

Permalink
Bug fixes for GCP modules (#55975)
Browse files Browse the repository at this point in the history
  • Loading branch information
modular-magician authored and ansibot committed May 20, 2019
1 parent e598eee commit d4b29e7
Show file tree
Hide file tree
Showing 23 changed files with 57 additions and 57 deletions.
6 changes: 3 additions & 3 deletions lib/ansible/modules/cloud/google/gcp_compute_router_facts.py
Expand Up @@ -65,8 +65,8 @@
'''

RETURN = '''
items:
description: List of items
resources:
description: List of resources
returned: always
type: complex
contains:
Expand Down Expand Up @@ -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)


Expand Down
Expand Up @@ -60,8 +60,8 @@
'''

RETURN = '''
items:
description: List of items
resources:
description: List of resources
returned: always
type: complex
contains:
Expand Down Expand Up @@ -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)


Expand Down
Expand Up @@ -60,8 +60,8 @@
'''

RETURN = '''
items:
description: List of items
resources:
description: List of resources
returned: always
type: complex
contains:
Expand Down Expand Up @@ -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)


Expand Down
Expand Up @@ -65,8 +65,8 @@
'''

RETURN = '''
items:
description: List of items
resources:
description: List of resources
returned: always
type: complex
contains:
Expand Down Expand Up @@ -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)


Expand Down
Expand Up @@ -60,8 +60,8 @@
'''

RETURN = '''
items:
description: List of items
resources:
description: List of resources
returned: always
type: complex
contains:
Expand Down Expand Up @@ -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)


Expand Down
Expand Up @@ -60,8 +60,8 @@
'''

RETURN = '''
items:
description: List of items
resources:
description: List of resources
returned: always
type: complex
contains:
Expand Down Expand Up @@ -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)


Expand Down
Expand Up @@ -65,8 +65,8 @@
'''

RETURN = '''
items:
description: List of items
resources:
description: List of resources
returned: always
type: complex
contains:
Expand Down Expand Up @@ -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)


Expand Down
Expand Up @@ -60,8 +60,8 @@
'''

RETURN = '''
items:
description: List of items
resources:
description: List of resources
returned: always
type: complex
contains:
Expand Down Expand Up @@ -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)


Expand Down
Expand Up @@ -60,8 +60,8 @@
'''

RETURN = '''
items:
description: List of items
resources:
description: List of resources
returned: always
type: complex
contains:
Expand Down Expand Up @@ -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)


Expand Down
Expand Up @@ -65,8 +65,8 @@
'''

RETURN = '''
items:
description: List of items
resources:
description: List of resources
returned: always
type: complex
contains:
Expand Down Expand Up @@ -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)


Expand Down
6 changes: 3 additions & 3 deletions lib/ansible/modules/cloud/google/gcp_compute_url_map_facts.py
Expand Up @@ -60,8 +60,8 @@
'''

RETURN = '''
items:
description: List of items
resources:
description: List of resources
returned: always
type: complex
contains:
Expand Down Expand Up @@ -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)


Expand Down
4 changes: 2 additions & 2 deletions test/integration/targets/gcp_compute_router/tasks/main.yml
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit d4b29e7

Please sign in to comment.