Remove debugging infrastructure.
Bug was found, and things seems to work. In summary, a comparison for
err != nil was performed where I intended err == nil instead.
diff --git a/acceptance/08-reauthentication.go b/acceptance/08-reauthentication.go
index 10cd73a..8b198c7 100644
--- a/acceptance/08-reauthentication.go
+++ b/acceptance/08-reauthentication.go
@@ -4,7 +4,6 @@
"fmt"
"flag"
"github.com/rackspace/gophercloud"
- "time"
)
var quiet = flag.Bool("quiet", false, "Quiet mode for acceptance testing. $? non-zero on error though.")
@@ -49,10 +48,6 @@
// Revoke our current authentication token.
auth.Revoke(auth.AuthToken())
- time.Sleep(15 * time.Second)
-
- auth.Reauthenticate()
- fmt.Println("OLD: ", token1, "\nNEW: ", auth.AuthToken())
// Attempt to list images again. This should _succeed_, because we enabled re-authentication.
_, err = servers.ListImages()
diff --git a/authenticate.go b/authenticate.go
index f98c4cc..07a5611 100644
--- a/authenticate.go
+++ b/authenticate.go
@@ -2,7 +2,6 @@
import (
"github.com/racker/perigee"
- "fmt"
)
// AuthOptions lets anyone calling Authenticate() supply the required access credentials.
@@ -159,11 +158,9 @@
var other *Access
var err error
- fmt.Printf("**\n %#v\n", a.options)
if a.options.AllowReauth {
other, err = a.context.papersPlease(a.provider, a.options)
- if err != nil {
- fmt.Println("NEW NEW: ", other.AuthToken())
+ if err == nil {
*a = *other
}
}