Samuel A. Falvo II | 2dd7d2f | 2014-06-30 16:18:08 -0700 | [diff] [blame] | 1 | // +build acceptance,old |
| 2 | |
Rafael Garcia | e4a550e | 2013-12-06 17:00:32 -0300 | [diff] [blame] | 3 | package main |
| 4 | |
| 5 | import ( |
Rafael Garcia | 752cb33 | 2013-12-12 22:16:58 -0300 | [diff] [blame] | 6 | "fmt" |
| 7 | "github.com/rackspace/gophercloud" |
| 8 | "os" |
| 9 | "strings" |
Rafael Garcia | e4a550e | 2013-12-06 17:00:32 -0300 | [diff] [blame] | 10 | ) |
| 11 | |
| 12 | func main() { |
Rafael Garcia | 752cb33 | 2013-12-12 22:16:58 -0300 | [diff] [blame] | 13 | provider, username, _, apiKey := getCredentials() |
Rafael Garcia | e4a550e | 2013-12-06 17:00:32 -0300 | [diff] [blame] | 14 | |
Rafael Garcia | 752cb33 | 2013-12-12 22:16:58 -0300 | [diff] [blame] | 15 | if !strings.Contains(provider, "rackspace") { |
| 16 | fmt.Fprintf(os.Stdout, "Skipping test because provider doesn't support API_KEYs\n") |
| 17 | return |
| 18 | } |
Rafael Garcia | e4a550e | 2013-12-06 17:00:32 -0300 | [diff] [blame] | 19 | |
Rafael Garcia | 752cb33 | 2013-12-12 22:16:58 -0300 | [diff] [blame] | 20 | _, err := gophercloud.Authenticate( |
| 21 | provider, |
| 22 | gophercloud.AuthOptions{ |
| 23 | Username: username, |
| 24 | ApiKey: apiKey, |
| 25 | }, |
| 26 | ) |
| 27 | if err != nil { |
| 28 | panic(err) |
| 29 | } |
Rafael Garcia | e4a550e | 2013-12-06 17:00:32 -0300 | [diff] [blame] | 30 | } |