Rafael Garcia | e4a550e | 2013-12-06 17:00:32 -0300 | [diff] [blame] | 1 | package main |
| 2 | |
| 3 | import ( |
Rafael Garcia | 752cb33 | 2013-12-12 22:16:58 -0300 | [diff] [blame] | 4 | "fmt" |
| 5 | "github.com/rackspace/gophercloud" |
| 6 | "os" |
| 7 | "strings" |
Rafael Garcia | e4a550e | 2013-12-06 17:00:32 -0300 | [diff] [blame] | 8 | ) |
| 9 | |
| 10 | func main() { |
Rafael Garcia | 752cb33 | 2013-12-12 22:16:58 -0300 | [diff] [blame] | 11 | provider, username, _, apiKey := getCredentials() |
Rafael Garcia | e4a550e | 2013-12-06 17:00:32 -0300 | [diff] [blame] | 12 | |
Rafael Garcia | 752cb33 | 2013-12-12 22:16:58 -0300 | [diff] [blame] | 13 | if !strings.Contains(provider, "rackspace") { |
| 14 | fmt.Fprintf(os.Stdout, "Skipping test because provider doesn't support API_KEYs\n") |
| 15 | return |
| 16 | } |
Rafael Garcia | e4a550e | 2013-12-06 17:00:32 -0300 | [diff] [blame] | 17 | |
Rafael Garcia | 752cb33 | 2013-12-12 22:16:58 -0300 | [diff] [blame] | 18 | _, 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 Garcia | e4a550e | 2013-12-06 17:00:32 -0300 | [diff] [blame] | 28 | } |