func()

in cli/io/config.go [140:164]


func (config *Config) getCredentialsOldStyle(target string) (username string, password string, err error) {
	auth, found := config.Map[authKey].(map[string]interface{})
	if !found {
		err = errors.New("No credentials for " + target)
		return
	}

	creds, found := auth[target].(map[string]interface{})
	if !found {
		err = errors.New("No credentials found for " + target)
		return
	}

	if username, found = creds[usernameKey].(string); !found {
		err = errors.New("No credentials for " + username)
		return
	}

	if password, found = creds[passwordKey].(string); !found {
		err = errors.New("No credentials for " + username)
		return
	}

	return username, password, err
}