Allow DNSNameservers and HostRoutes to be removed
Check against nil instead of len == 0 when updating DNSNameservers and
HostRoutes. This allows the removal of already configured properties.
diff --git a/openstack/networking/v2/subnets/requests.go b/openstack/networking/v2/subnets/requests.go
index 2368bf5..6cde048 100644
--- a/openstack/networking/v2/subnets/requests.go
+++ b/openstack/networking/v2/subnets/requests.go
@@ -202,10 +202,10 @@
if opts.GatewayIP != "" {
s["gateway_ip"] = opts.GatewayIP
}
- if len(opts.DNSNameservers) != 0 {
+ if opts.DNSNameservers != nil {
s["dns_nameservers"] = opts.DNSNameservers
}
- if len(opts.HostRoutes) != 0 {
+ if opts.HostRoutes != nil {
s["host_routes"] = opts.HostRoutes
}