blob: fd1dedaed4faf5f6194a010bf6175606897db296 [file] [log] [blame]
Jon Perrittf050a4c2014-09-11 15:01:17 -05001// +build acceptance
2
3package v1
4
5import (
Jon Perritt2a7797d2014-10-21 15:08:43 -05006 "os"
7
Jon Perrittf050a4c2014-09-11 15:01:17 -05008 "github.com/rackspace/gophercloud"
9 "github.com/rackspace/gophercloud/openstack"
Jon Perritt2a7797d2014-10-21 15:08:43 -050010 th "github.com/rackspace/gophercloud/testhelper"
Jon Perrittf050a4c2014-09-11 15:01:17 -050011)
12
13var metadata = map[string]string{"gopher": "cloud"}
14
15func newClient() (*gophercloud.ServiceClient, error) {
Jamie Hannaford390555a2014-10-22 17:04:03 +020016 ao, err := openstack.AuthOptionsFromEnv()
Jon Perritt2a7797d2014-10-21 15:08:43 -050017 th.AssertNoErr(t, err)
Jon Perrittf050a4c2014-09-11 15:01:17 -050018
19 client, err := openstack.AuthenticatedClient(ao)
Jon Perritt2a7797d2014-10-21 15:08:43 -050020 th.AssertNoErr(t, err)
Jon Perrittf050a4c2014-09-11 15:01:17 -050021
Jon Perritt2a7797d2014-10-21 15:08:43 -050022 return openstack.NewObjectStorageV1(client, gophercloud.EndpointOpts{
Jon Perrittf050a4c2014-09-11 15:01:17 -050023 Region: os.Getenv("OS_REGION_NAME"),
Jon Perritt2a7797d2014-10-21 15:08:43 -050024 }), nil
Jon Perrittf050a4c2014-09-11 15:01:17 -050025}