Conversation
|
Build failed.
|
|
Looking back at #689, one thing I didn't catch was that the spec key needs to be in the URL. I also tested my theory and Nova is only allowing one spec to pass. Because of these two things, I wonder if we should use the same method that server/instance metadatum creation is doing: https://github.com/gophercloud/gophercloud/blob/master/openstack/compute/v2/servers/requests.go#L646-L684. The idea here would be to have the function signature as: Another option is to have a signature like Both would remove the requirement of having to specify the key twice: once in the I'm leaning on the former since it follows the usual pattern of updates in Gophercloud. Thoughts? |
d952b0b to
35ab3f1
Compare
|
I think I misunderstood your original comment about where the error should be handled. I have now updated the patch to limit accepted options to 1 key-pair on the gophercloud side and obtain the key for the URL parameter from that key. This makes more sense. It also allows update to add additional (new) extra specs, better exposing the supported nova API behavior. |
|
This method rather than the second option you presented also allows potential extensibility where hard-coding both parameters would not. |
|
Build succeeded.
|
|
recheck |
|
Build succeeded.
|
You didn't at all - my original comment was incorrect, so it's on me - sorry about that! This looks good. Thank you for working on this series :) |
|
recheck |
|
Build succeeded.
|
* Internal: Networking V2 Router cleanup Cleanup messages and variables definition for the openstack_networking_router_v2 resource. Implement helper functions in openstack/networking_router_v2.go with tests. * Remove old in-tree SDK from router helpers Fix openstack/networking_router_v2.go imports and run go mod tidy, go mod vendor.
For #540
Links to the line numbers/files in the OpenStack source code that support the
code in this PR:
API reference:
https://developer.openstack.org/api-ref/compute/#update-an-extra-spec-for-a-flavor
Nova implementation:
https://github.com/openstack/nova/blob/stable/pike/nova/api/openstack/compute/flavors_extraspecs.py#L79
Schema:
https://github.com/openstack/nova/blob/stable/pike/nova/api/openstack/compute/schemas/flavors_extraspecs.py#L24
https://github.com/openstack/nova/blob/stable/pike/nova/api/validation/parameter_types.py#L363-L371
The API will return an error if more than one key-value pair is passed and also if the key differs from the key parameter on the URL. As the API accepts more than one key-value pair and then properly returns an error, per the discussion on #689, the API is left to do the error handling.