Jon Perritt | f050a4c | 2014-09-11 15:01:17 -0500 | [diff] [blame] | 1 | // +build acceptance |
| 2 | |
| 3 | package v1 |
| 4 | |
| 5 | import ( |
| 6 | "github.com/rackspace/gophercloud" |
| 7 | "github.com/rackspace/gophercloud/openstack" |
| 8 | "github.com/rackspace/gophercloud/openstack/utils" |
| 9 | "os" |
| 10 | ) |
| 11 | |
| 12 | var metadata = map[string]string{"gopher": "cloud"} |
| 13 | |
| 14 | func newClient() (*gophercloud.ServiceClient, error) { |
| 15 | ao, err := utils.AuthOptions() |
| 16 | if err != nil { |
| 17 | return nil, err |
| 18 | } |
| 19 | |
| 20 | client, err := openstack.AuthenticatedClient(ao) |
| 21 | if err != nil { |
| 22 | return nil, err |
| 23 | } |
| 24 | |
| 25 | return openstack.NewStorageV1(client, gophercloud.EndpointOpts{ |
| 26 | Region: os.Getenv("OS_REGION_NAME"), |
| 27 | }) |
| 28 | } |