Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make compatible with strict variables. #66

Merged
merged 1 commit into from
Mar 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions manifests/fetch.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@

include wget

# The strict_variables setting aborts compilation referencing unset variables.
$strict = defined('$::settings::strict_variables') and $::settings::strict_variables

if $strict and !defined('$schedule') {
$schedule = undef
}

# Does $destination end in a slash? If so, treat as a directory
case $destination {
# This is a nasty looking regex but it's simply checking to see if the $destination
Expand All @@ -47,13 +54,24 @@
}
}

$http_proxy_env = $::http_proxy ? {
if $strict and !defined('$::http_proxy') {
$http_proxy = undef
} else {
$http_proxy = $::http_proxy
}
if $strict and !defined('$::https_proxy') {
$https_proxy = undef
} else {
$https_proxy = $::https_proxy
}

$http_proxy_env = $http_proxy ? {
undef => [],
default => [ "HTTP_PROXY=${::http_proxy}", "http_proxy=${::http_proxy}" ],
default => [ "HTTP_PROXY=${http_proxy}", "http_proxy=${http_proxy}" ],
}
$https_proxy_env = $::https_proxy ? {
$https_proxy_env = $https_proxy ? {
undef => [],
default => [ "HTTPS_PROXY=${::https_proxy}", "https_proxy=${::https_proxy}" ],
default => [ "HTTPS_PROXY=${https_proxy}", "https_proxy=${https_proxy}" ],
}
$password_env = $user ? {
undef => [],
Expand Down