Skip to content

Commit

Permalink
fix linter error
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
  • Loading branch information
bpg authored and vanillaSprinkles committed Oct 2, 2024
1 parent ad178ca commit e39d152
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions proxmoxtf/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,24 @@ func providerConfigure(_ context.Context, d *schema.ResourceData) (interface{},
sshSocks5Password := utils.GetAnyStringEnv("PROXMOX_VE_SSH_SOCKS5_PASSWORD")

if v, ok := sshConf[mkProviderSSHUsername]; !ok || v.(string) == "" {
if sshUsername != "" {
switch {
case sshUsername != "":
sshConf[mkProviderSSHUsername] = sshUsername
} else if creds.UserCredentials != nil {
case creds.UserCredentials != nil:
sshConf[mkProviderSSHUsername] = strings.Split(creds.UserCredentials.Username, "@")[0]
default:
sshConf[mkProviderSSHUsername] = ""
}
}

if v, ok := sshConf[mkProviderSSHPassword]; !ok || v.(string) == "" {
if sshPassword != "" {
switch {
case sshPassword != "":
sshConf[mkProviderSSHPassword] = sshPassword
} else if creds.UserCredentials != nil {
case creds.UserCredentials != nil:
sshConf[mkProviderSSHPassword] = creds.UserCredentials.Password
default:
sshConf[mkProviderSSHPassword] = ""
}
}

Expand Down

0 comments on commit e39d152

Please sign in to comment.