Skip to content

Instantly share code, notes, and snippets.

@carlpett
Created July 6, 2016 12:32
Show Gist options
  • Save carlpett/cfef6867d2f5445774fb6a9ca6728efa to your computer and use it in GitHub Desktop.
Save carlpett/cfef6867d2f5445774fb6a9ca6728efa to your computer and use it in GitHub Desktop.
diff --git a/gophercloud/openstack/networking/v2/extensions/fwaas/rules/requests.go b/gophercloud/openstack/networking/v2/extensions/fwaas/rules/requests.go index 57a0e8b..1efc26d 100644
--- a/gophercloud/openstack/networking/v2/extensions/fwaas/rules/requests.go
+++ b/gophercloud/openstack/networking/v2/extensions/fwaas/rules/requests.go
@@ -116,7 +116,11 @@ func (opts CreateOpts) ToRuleCreateMap() (map[string]interface{}, error) {
r := make(map[string]interface{})
- r["protocol"] = opts.Protocol
+ if opts.Protocol == "any" {
+ r["protocol"] = nil
+ } else {
+ r["protocol"] = opts.Protocol
+ }
r["action"] = opts.Action
if opts.TenantID != "" {
@@ -203,7 +207,11 @@ func (opts UpdateOpts) ToRuleUpdateMap() (map[string]interface{}, error) {
r := make(map[string]interface{})
if opts.Protocol != "" {
- r["protocol"] = opts.Protocol
+ if opts.Protocol == "any" {
+ r["protocol"] = nil
+ } else {
+ r["protocol"] = opts.Protocol
+ }
}
if opts.Action != "" {
r["action"] = opts.Action
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment