Remove duplicate code from acceptance tests.
Just cleaning things up here.
diff --git a/acceptance/02-list-servers.go b/acceptance/02-list-servers.go
index acfc802..64ec4f6 100644
--- a/acceptance/02-list-servers.go
+++ b/acceptance/02-list-servers.go
@@ -3,25 +3,13 @@
import (
"fmt"
"github.com/rackspace/gophercloud"
- "os"
"flag"
)
var quiet = flag.Bool("quiet", false, "Quiet mode, for acceptance testing. $? still indicates errors though.")
func main() {
- provider := os.Getenv("SDK_PROVIDER")
- username := os.Getenv("SDK_USERNAME")
- password := os.Getenv("SDK_PASSWORD")
-
- if (provider == "") || (username == "") || (password == "") {
- fmt.Fprintf(os.Stderr, "One or more of the following environment variables aren't set:\n")
- fmt.Fprintf(os.Stderr, " SDK_PROVIDER=\"%s\"\n", provider)
- fmt.Fprintf(os.Stderr, " SDK_USERNAME=\"%s\"\n", username)
- fmt.Fprintf(os.Stderr, " SDK_PASSWORD=\"%s\"\n", password)
- os.Exit(1)
- }
-
+ provider, username, password := getCredentials()
flag.Parse()
acc, err := gophercloud.Authenticate(