Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Partial Updates #63

Merged
merged 1 commit into from
Aug 20, 2018
Merged

Partial Updates #63

merged 1 commit into from
Aug 20, 2018

Conversation

modular-magician
Copy link
Owner

"projects/{project}/zones/{zone}/disks/{name}/setLabels"
]).format(**module.params),
{
u'labels': module.params.get('labels')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll also need to send labelFingerprint, here and elsewhere.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I need to? I currently do not support beta APIs on Ansible, but we list all of the labelFingerprints as beta only.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh! Well, you do need to, but that probably represents an error in api.yaml.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disk labels are GA!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to have been fixed.

Copy link
Collaborator

@rambleraptor rambleraptor Aug 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to fix that in this PR? I didn't know if that would clutter it up too much (we'd have changes in P/C/A/T from doing that)

Should've specified that earlier.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to do it - otherwise you're submitting code that doesn't work. :(

@rambleraptor rambleraptor changed the title Magic Modules changes. Partial Updates Aug 10, 2018
@@ -427,6 +427,8 @@ def main():
if fetch:
if state == 'present':
if is_different(module, fetch):
update_fields(module, resource_to_request(module),
response_to_hash(module, fetch))
fetch = update(module, self_link(module), kind)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same deal here as the others- it should be either a partial or a full, not both

u'labels': module.params.get('labels')
}
)
if response.get('sizeGb') != request.get('sizeGb'):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someday, you're going to want to inject a "not quite just literal comparisons only" bit here - a canonicalizer, we used to call them in Maps. Don't have to do it today.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call! I'm going to make a issue for this.

@@ -236,6 +236,12 @@
- Labels to apply to this VpnTunnel.
returned: success
type: dict
label_fingerprint:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might find this upsetting, but unfortunately networking resources only accept labels via SetLabels calls - they do not work on create.

Copy link
Collaborator

@nat-henderson nat-henderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll probably want to figure out the networking resources create vs update issue - if you don't want to figure it out today, let me know and I imagine some functionality is better than no functionality.

@rambleraptor
Copy link
Collaborator

I updated this with VpnTunnel. Not sure what you consider a networking resource.

sizegb_update(module, request, response)


def labelfingerprint_update(module, request, response):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would help readability for this to be label_fingerprint_update.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Fixed! Running through the magician now.

@rambleraptor rambleraptor merged commit 456d5ef into devel Aug 20, 2018
rambleraptor pushed a commit that referenced this pull request Sep 21, 2018
rambleraptor pushed a commit that referenced this pull request May 21, 2019
modular-magician pushed a commit that referenced this pull request Aug 28, 2019
* add locks

* rename the module

* add test

* add test

* address comments

* add quote

* can list child scope lock

* minor docs tweaks

* Add files via upload (#62)

* change '\r\n' to '\n' (#63)

* Small changes, just to trigger CI verify.

* trigger CI verify

* remove 's'

* Update according by comments

* change small for trigger CI check
modular-magician added a commit that referenced this pull request Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants