Skip to content

Fix security group rule "any protocol" #3162

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

Conversation

pierreprinetti
Copy link
Member

Backport of #3157

Before this patch, Gophercloud attempted to create a security group rule that would be applied regardless of the protocol by passing the literal "any" as the rule protocol.

Despite being correct according to the documentation, Neutron rejects the value "any" with an HTTP status code of 400 Bad Request.

This change replaces the value of ProtocolAny to be the empty string "", which has the effect of creating a rule that applies to any protocol.

cf: Neutron bug 2074056

Fixes #2442

Before this patch, Gophercloud attempted to create a security group rule
that would be applied regardless of the protocol by passing the literal
`"any"` as the rule protocol.

Despite being correct according to [the documentation][1], Neutron
rejects the value `"any"` with an HTTP status code of  `400 Bad
Request`.

This change replaces the value of `ProtocolAny` to be the empty string
`""`, which has the effect of creating a rule that applies to any
protocol.

cf: [Neutron bug 2074056][2]

[1]: https://docs.openstack.org/api-ref/network/v2/#create-security-group-rule
[2]: https://bugs.launchpad.net/neutron/+bug/2074056
@pierreprinetti pierreprinetti requested a review from a team July 29, 2024 08:05
@github-actions github-actions bot added edit:networking This PR updates networking code v1 This PR targets v1 semver:major Breaking change labels Jul 29, 2024
@pierreprinetti pierreprinetti added semver:patch No API change and removed semver:major Breaking change labels Jul 29, 2024
@coveralls
Copy link

Coverage Status

coverage: 78.021%. remained the same
when pulling 4ffa3ea on shiftstack:sec_group_rule_create_any_protocol
into 5de92f2 on gophercloud:v1.

@pierreprinetti pierreprinetti merged commit 7121f43 into gophercloud:v1 Jul 29, 2024
21 checks passed
@pierreprinetti pierreprinetti deleted the sec_group_rule_create_any_protocol branch July 29, 2024 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
edit:networking This PR updates networking code semver:patch No API change v1 This PR targets v1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants