8000 Bug fixes for GCP (as of 2019-06-14T06:06:00Z) by modular-magician · Pull Request #58016 · ansible/ansible · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Bug fixes for GCP (as of 2019-06-14T06:06:00Z) #58016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ansible/modules/cloud/google/gcp_container_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None):
if extra_data is None:
extra_data = {}
url = "https://container.googleapis.com/v1/projects/{project}/zones/{zone}/operations/{op_id}"
url = "https://container.googleapis.com/v1/projects/{project}/locations/{location}/operations/{op_id}"
combined = extra_data.copy()
combined.update(module.params)
return url.format(**combined)
Expand Down
6 changes: 3 additions & 3 deletions lib/ansible/modules/cloud/google/gcp_container_node_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,12 @@ def self_link(module):
'cluster': replace_resource_dict(module.params['cluster'], 'name'),
'name': module.params['name'],
}
return "https://container.googleapis.com/v1/projects/{project}/zones/{location}/clusters/{cluster}/nodePools/{name}".format(**res)
return "https://container.googleapis.com/v1/projects/{project}/locations/{location}/clusters/{cluster}/nodePools/{name}".format(**res)


def collection(module):
res = {'project': module.params['project'], 'location': module.params['location'], 'cluster': replace_resource_dict(module.params['cluster'], 'name')}
return "https://container.googleapis.com/v1/projects/{project}/zones/{location}/clusters/{cluster}/nodePools".format(**res)
return "https://container.googleapis.com/v1/projects/{project}/locations/{location}/clusters/{cluster}/nodePools".format(**res)


def return_if_object(module, response, allow_not_found=False):
Expand Down Expand Up @@ -773,7 +773,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None):
if extra_data is None:
extra_data = {}
url = "https://container.googleapis.com/v1/projects/{project}/zones/{zone}/operations/{op_id}"
url = "https://container.googleapis.com/v1/projects/{project}/locations/{location}/operations/{op_id}"
combined = extra_data.copy()
combined.update(module.params)
return url.format(**combined)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def main():

def collection(module):
res = {'project': module.params['project'], 'location': module.params['location'], 'cluster': replace_resource_dict(module.params['cluster'], 'name')}
return "https://container.googleapis.com/v1/projects/{project}/zones/{location}/clusters/{cluster}/nodePools".format(**res)
return "https://container.googleapis.com/v1/projects/{project}/locations/{location}/clusters/{cluster}/nodePools".format(**res)


def fetch_list(module, link):
Expand Down
4 changes: 2 additions & 2 deletions test/integration/targets/gcp_container_cluster/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
- name: verify that command succeeded
assert:
that:
- "'my-cluster' in \"{{ results['items'] | map(attribute='name') | list }}\""
- "'my-cluster' in \"{{ results['resources'] | map(attribute='name') | list }}\""
# ----------------------------------------------------------------------------
- name: create a cluster that already exists
gcp_container_cluster:
Expand Down Expand Up @@ -116,7 +116,7 @@
- name: verify that command succeeded
assert:
that:
- "'my-cluster' not in \"{{ results['items'] | map(attribute='name') | list }}\""
- "'my-cluster' not in \"{{ results['resources'] | map(attribute='name') | list }}\""
# ----------------------------------------------------------------------------
- name: delete a cluster that does not exist
gcp_container_cluster:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
- name: verify that command succeeded
assert:
that:
- "'my-pool' in \"{{ results['items'] | map(attribute='name') | list }}\""
- "'my-pool' in \"{{ results['resources'] | map(attribute='name') | list }}\""
# ----------------------------------------------------------------------------
- name: create a node pool that already exists
gcp_container_node_pool:
Expand Down Expand Up @@ -108,7 +108,7 @@
- name: verify that command succeeded
assert:
that:
- "'my-pool' not in \"{{ results['items'] | map(attribute='name') | list }}\""
- "'my-pool' not in \"{{ results['resources'] | map(attribute='name') | list }}\""
# ----------------------------------------------------------------------------
- name: delete a node pool that does not exist
gcp_container_node_pool:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
- name: verify that command succeeded
assert:
that:
- "'www.testzone-4.com.'in \"{{ results['items'] | map(attribute='name') | list }}\""
- "'www.testzone-4.com.'in \"{{ results['resources'] | map(attribute='name') | list }}\""
# ----------------------------------------------------------------------------
- name: create a resource record set that already exists
gcp_dns_resource_record_set:
Expand Down Expand Up @@ -121,7 +121,7 @@
- name: verify that command succeeded
assert:
that:
- "'www.testzone-4.com.'not in \"{{ results['items'] | map(attribute='name') | list }}\""
- "'www.testzone-4.com.'not in \"{{ results['resources'] | map(attribute='name') | list }}\""
# ----------------------------------------------------------------------------
- name: delete a resource record set that does not exist
gcp_dns_resource_record_set:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
- name: verify that command succeeded
assert:
that:
- "\"{{resource_name}}\" in \"{{ results['items'] | map(attribute='name') | list }}\""
- "\"{{resource_name}}\" in \"{{ results['resources'] | map(attribute='name') | list }}\""
# ----------------------------------------------------------------------------
- name: create a subscription that already exists
gcp_pubsub_subscription:
Expand Down Expand Up @@ -98,7 +98,7 @@
- name: verify that command succeeded
assert:
that:
- "\"{{resource_name}}\" not in \"{{ results['items'] | map(attribute='name') | list }}\""
- "\"{{resource_name}}\" not in \"{{ results['resources'] | map(attribute='name') | list }}\""
# ----------------------------------------------------------------------------
- name: delete a subscription that does not exist
gcp_pubsub_subscription:
Expand Down
4 changes: 2 additions & 2 deletions test/integration/targets/gcp_pubsub_topic/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
- name: verify that command succeeded
assert:
that:
- "'test-topic1' in \"{{ results['items'] | map(attribute='name') | list }}\""
- "'test-topic1' in \"{{ results['resources'] | map(attribute='name') | list }}\""
# ----------------------------------------------------------------------------
- name: create a topic that already exists
gcp_pubsub_topic:
Expand Down Expand Up @@ -82,7 +82,7 @@
- name: verify that command succeeded
assert:
that:
- "'test-topic1' not in \"{{ results['items'] | map(attribute='name') | list }}\""
- "'test-topic1' not in \"{{ results['resources'] | map(attribute='name') | list }}\""
# ----------------------------------------------------------------------------
- name: delete a topic that does not exist
gcp_pubsub_topic:
Expand Down
0