Github user Graeme-Miller commented on a diff in the pull request:
https://github.com/apache/brooklyn-client/pull/42#discussion_r118458240
--- Diff: cli/br/brooklyn.go ---
@@ -30,27 +30,14 @@ import (
"path/filepath"
)
-func getNetworkCredentialsFromConfig(yamlMap map[string]interface{})
(string, string, string, bool) {
- var target, username, password string
- var skipSslChecks bool
- target, found := yamlMap["target"].(string)
- if found {
- auth, found := yamlMap["auth"].(map[string]interface{})
- if found {
- creds := auth[target].(map[string]interface{})
- username, found = creds["username"].(string)
- if found {
- password, found = creds["password"].(string)
- }
- }
- skipSslChecks, _ = yamlMap["skipSslChecks"].(bool)
- }
- return target, username, password, skipSslChecks
-}
-
func main() {
config := io.GetConfig()
- target, username, password, skipSslChecks :=
getNetworkCredentialsFromConfig(config.Map)
+ skipSslChecks := config.GetSkipSslChecks()
+ target, username, password, err := config.GetNetworkCredentials()
+ if err != nil && !isLogin(os.Args) {
--- End diff --
It might read nicer to skip config.GetNetworkCredentials() if it is login,
rather than ignore the error
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---