diff --git a/command/build.go b/command/build.go index d7cf10962..d60c921b5 100644 --- a/command/build.go +++ b/command/build.go @@ -113,7 +113,7 @@ func (m *Meta) GetConfig(cla *MetaArgs) (packer.Handler, int) { // This is an internal-only method that should be called by commands that don't have // a different mode when handling legacy JSON templates; mainly build, validate. func DisplayLegacyConfigWarning(ui packersdk.Ui) { - if v, ok := os.LookupEnv("PACKER_LEGACY_MODE"); ok && strings.ToLower(v) == "on" { + if v := os.Getenv("PACKER_LEGACY_MODE"); strings.ToLower(v) == "on" { return } diff --git a/command/vendored_plugins.go b/command/vendored_plugins.go index a8328b316..7a18585ef 100644 --- a/command/vendored_plugins.go +++ b/command/vendored_plugins.go @@ -194,7 +194,7 @@ func init() { // By default PACKER_LEGACY_MODE=auto to enable automatic loading of vendored plugins. // In preparation for removing vendored plugins entirely we are providing users a flag to // to control if vendored plugins should be loaded or not. - if v, ok := os.LookupEnv("PACKER_LEGACY_MODE"); ok && strings.ToLower(v) == "off" { + if v := os.Getenv("PACKER_LEGACY_MODE"); strings.ToLower(v) == "off" { return }