Removing unnecessary references
diff --git a/openstack/networking/v2/extensions/external/requests.go b/openstack/networking/v2/extensions/external/requests.go
index 0d20bb1..a29c2fa 100644
--- a/openstack/networking/v2/extensions/external/requests.go
+++ b/openstack/networking/v2/extensions/external/requests.go
@@ -2,6 +2,18 @@
import "github.com/rackspace/gophercloud/openstack/networking/v2/networks"
+type AdminState *bool
+
+// Convenience vars for AdminStateUp values.
+var (
+ iTrue = true
+ iFalse = false
+
+ Nothing AdminState = nil
+ Up AdminState = &iTrue
+ Down AdminState = &iFalse
+)
+
type CreateOpts struct {
Parent networks.CreateOpts
External bool
diff --git a/openstack/networking/v2/extensions/external/results_test.go b/openstack/networking/v2/extensions/external/results_test.go
index 9831d8b..2064433 100644
--- a/openstack/networking/v2/extensions/external/results_test.go
+++ b/openstack/networking/v2/extensions/external/results_test.go
@@ -182,8 +182,7 @@
`)
})
- iTrue := true
- options := CreateOpts{networks.CreateOpts{Name: "ext_net", AdminStateUp: &iTrue}, true}
+ options := CreateOpts{networks.CreateOpts{Name: "ext_net", AdminStateUp: Up}, true}
res := networks.Create(serviceClient(), options)
n, err := ExtractCreate(res)
diff --git a/openstack/networking/v2/extensions/provider/results.go b/openstack/networking/v2/extensions/provider/results.go
index 11b0604..96caac1 100755
--- a/openstack/networking/v2/extensions/provider/results.go
+++ b/openstack/networking/v2/extensions/provider/results.go
@@ -8,6 +8,18 @@
"github.com/rackspace/gophercloud/pagination"
)
+type AdminState *bool
+
+// Convenience vars for AdminStateUp values.
+var (
+ iTrue = true
+ iFalse = false
+
+ Nothing AdminState = nil
+ Up AdminState = &iTrue
+ Down AdminState = &iFalse
+)
+
// NetworkExtAttrs represents an extended form of a Network with additional fields.
type NetworkExtAttrs struct {
// UUID for the network
diff --git a/openstack/networking/v2/extensions/provider/results_test.go b/openstack/networking/v2/extensions/provider/results_test.go
index 110123a..20b95c9 100644
--- a/openstack/networking/v2/extensions/provider/results_test.go
+++ b/openstack/networking/v2/extensions/provider/results_test.go
@@ -196,8 +196,7 @@
`)
})
- iTrue := true
- options := networks.CreateOpts{Name: "sample_network", AdminStateUp: &iTrue}
+ options := networks.CreateOpts{Name: "sample_network", AdminStateUp: Up}
res := networks.Create(serviceClient(), options)
n, err := ExtractCreate(res)