Skip to content

Commit

Permalink
fixed bug where the project name was not being read from configuratio…
Browse files Browse the repository at this point in the history
…n if it was provided via the "tenant" attribute. this was causing the swift client to crash with an EOF error. (#2803)
  • Loading branch information
mevansam authored and jefferai committed Jun 5, 2017
1 parent e3cc07c commit 65b9c35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions physical/swift.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ type SwiftBackend struct {
// from the environment.
func newSwiftBackend(conf map[string]string, logger log.Logger) (Backend, error) {

var ok bool

username := os.Getenv("OS_USERNAME")
if username == "" {
username = conf["username"]
Expand Down Expand Up @@ -60,11 +62,9 @@ func newSwiftBackend(conf map[string]string, logger log.Logger) (Backend, error)
}
project := os.Getenv("OS_PROJECT_NAME")
if project == "" {
project = conf["project"]

if project == "" {
if project, ok = conf["project"]; !ok {
// Check for KeyStone naming prior to V3
project := os.Getenv("OS_TENANT_NAME")
project = os.Getenv("OS_TENANT_NAME")
if project == "" {
project = conf["tenant"]
}
Expand Down

0 comments on commit 65b9c35

Please sign in to comment.