22
23
func (OpenstackCredentials) CredentialSchemas() map[cloud.AuthType]cloud.CredentialSchema {
23
24
return map[cloud.AuthType]cloud.CredentialSchema{
24
25
cloud.UserPassAuthType: {
26
Description: "The username to authenticate with.",
29
Description: "The password for the specified username.",
33
Description: "The OpenStack tenant name.",
27
"username", cloud.CredentialAttr{Description: "The username to authenticate with."},
29
"password", cloud.CredentialAttr{
30
Description: "The password for the specified username.",
34
"tenant-name", cloud.CredentialAttr{Description: "The OpenStack tenant name."},
36
"domain-name", cloud.CredentialAttr{
37
Description: "The OpenStack domain name.",
36
42
cloud.AccessKeyAuthType: {
38
Description: "The access key to authenticate with.",
41
Description: "The secret key to authenticate with.",
45
Description: "The OpenStack tenant name.",
44
"access-key", cloud.CredentialAttr{Description: "The access key to authenticate with."},
46
"secret-key", cloud.CredentialAttr{
47
Description: "The secret key to authenticate with.",
51
"tenant-name", cloud.CredentialAttr{Description: "The OpenStack tenant name."},
68
74
return nil, errors.Annotate(err, "loading novarc file")
76
stripExport := regexp.MustCompile(`(?i)^\s*export\s*`)
70
77
keyValues := novaInfo.Section(ini.DEFAULT_SECTION).KeysHash()
71
78
if len(keyValues) > 0 {
72
79
for k, v := range keyValues {
80
k = stripExport.ReplaceAllString(k, "")
75
83
creds, user, region, err := c.detectCredential()