Skip to content

Commit f2266d7

Browse files
author
Jarl Stefansson
committed
Fix bash logic false positives
1 parent 44acbef commit f2266d7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

manifests/pip.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
case $ensure {
9797
present: {
9898
exec { "pip_install_${name}":
99-
command => "$pip_env wheel --help && pip wheel --version || wheel_support_flag='--no-use-wheel'; $pip_env --log ${cwd}/pip.log install $install_args \$wheel_support_flag ${proxy_flag} ${source}",
99+
command => "$pip_env wheel --help && (pip wheel --version || wheel_support_flag='--no-use-wheel'); $pip_env --log ${cwd}/pip.log install $install_args \$wheel_support_flag ${proxy_flag} ${source}",
100100
unless => "$pip_env freeze | grep -i -e ${grep_regex}",
101101
user => $owner,
102102
environment => $environment,
@@ -106,7 +106,7 @@
106106

107107
latest: {
108108
exec { "pip_install_${name}":
109-
command => "$pip_env wheel --help && pip wheel --version || wheel_support_flag='--no-use-wheel'; $pip_env --log ${cwd}/pip.log install --upgrade \$wheel_support_flag ${proxy_flag} ${source}",
109+
command => "$pip_env wheel --help && (pip wheel --version || wheel_support_flag='--no-use-wheel'); $pip_env --log ${cwd}/pip.log install --upgrade \$wheel_support_flag ${proxy_flag} ${source}",
110110
user => $owner,
111111
environment => $environment,
112112
path => ["/usr/local/bin","/usr/bin","/bin", "/usr/sbin"],
@@ -115,7 +115,7 @@
115115

116116
latest: {
117117
exec { "pip_install_${name}":
118-
command => "$pip_env wheel --help && pip wheel --version || wheel_support_flag='--no-use-wheel'; $pip_env --log ${cwd}/pip.log install -U $install_args \$wheel_support_flag ${proxy_flag} ${source}",
118+
command => "$pip_env wheel --help && (pip wheel --version || wheel_support_flag='--no-use-wheel'); $pip_env --log ${cwd}/pip.log install -U $install_args \$wheel_support_flag ${proxy_flag} ${source}",
119119
user => $owner,
120120
environment => $environment,
121121
}

manifests/virtualenv.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
# version, this makes sure we only use wheels if they are supported
128128

129129
exec { "python_virtualenv_${venv_dir}":
130-
command => "mkdir -p ${venv_dir} ${proxy_command} && virtualenv ${system_pkgs_flag} -p ${python} ${venv_dir} && ${venv_dir}/bin/pip $pip_env wheel --help && ${venv_dir}/bin/pip wheel --version || wheel_support_flag='--no-use-wheel'; ${venv_dir}/bin/pip --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} \$wheel_support_flag --upgrade pip ${distribute_pkg}",
130+
command => "mkdir -p ${venv_dir} ${proxy_command} && virtualenv ${system_pkgs_flag} -p ${python} ${venv_dir} && ${venv_dir}/bin/pip $pip_env wheel --help && (${venv_dir}/bin/pip wheel --version || wheel_support_flag='--no-use-wheel'); ${venv_dir}/bin/pip --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} \$wheel_support_flag --upgrade pip ${distribute_pkg}",
131131
user => $owner,
132132
path => $path,
133133
cwd => "/tmp",

0 commit comments

Comments
 (0)