Code maintenance: GetPassword signature changed

This commit is contained in:
Quentin McGaw
2020-12-29 20:06:24 +00:00
parent 96f2b2b617
commit 258e150ebf
3 changed files with 9 additions and 10 deletions

View File

@@ -18,15 +18,13 @@ func (r *reader) GetUser() (user string, err error) {
}
// GetPassword obtains the password to use to connect to the VPN servers.
func (r *reader) GetPassword(required bool) (s string, err error) {
func (r *reader) GetPassword() (s string, err error) {
options := []libparams.GetEnvSetter{
libparams.CaseSensitiveValue(),
libparams.Unset(),
libparams.Compulsory(),
libparams.RetroKeys([]string{"PASSWORD"}, r.onRetroActive),
}
if required {
options = append(options, libparams.Compulsory())
}
return r.envParams.GetEnv("OPENVPN_PASSWORD", options...)
}