blob: 2374efb7c9102e8e8f6e768a10226edbe3163a78 [file] [log] [blame]
Rafael Garciae4a550e2013-12-06 17:00:32 -03001package main
2
3import (
Rafael Garcia752cb332013-12-12 22:16:58 -03004 "fmt"
5 "github.com/rackspace/gophercloud"
6 "os"
7 "strings"
Rafael Garciae4a550e2013-12-06 17:00:32 -03008)
9
10func main() {
Rafael Garcia752cb332013-12-12 22:16:58 -030011 provider, username, _, apiKey := getCredentials()
Rafael Garciae4a550e2013-12-06 17:00:32 -030012
Rafael Garcia752cb332013-12-12 22:16:58 -030013 if !strings.Contains(provider, "rackspace") {
14 fmt.Fprintf(os.Stdout, "Skipping test because provider doesn't support API_KEYs\n")
15 return
16 }
Rafael Garciae4a550e2013-12-06 17:00:32 -030017
Rafael Garcia752cb332013-12-12 22:16:58 -030018 _, err := gophercloud.Authenticate(
19 provider,
20 gophercloud.AuthOptions{
21 Username: username,
22 ApiKey: apiKey,
23 },
24 )
25 if err != nil {
26 panic(err)
27 }
Rafael Garciae4a550e2013-12-06 17:00:32 -030028}