Skip to content

Commit 55cae98

Browse files
committed
remove the need of _group
1 parent 9239cc2 commit 55cae98

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

manifests/pip.pp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
Enum['pip', 'pip3'] $pip_provider = 'pip',
5656
Variant[Boolean, String] $url = false,
5757
String[1] $owner = 'root',
58-
$group = undef,
58+
$group = getparam(Class['python'], 'group'),
5959
$umask = undef,
6060
$index = false,
6161
Variant[Boolean, String] $proxy = false,
@@ -71,11 +71,7 @@
7171
){
7272
$python_provider = getparam(Class['python'], 'provider')
7373
$python_version = getparam(Class['python'], 'version')
74-
if $group {
75-
$_group = $group
76-
} else {
77-
$_group = getparam(Class['python'], 'group')
78-
}
74+
7975
# Get SCL exec prefix
8076
# NB: this will not work if you are running puppet from scl enabled shell
8177
$exec_prefix = $python_provider ? {
@@ -187,7 +183,7 @@
187183
command => "${wheel_check} ; { ${pip_install} ${install_args} \$wheel_support_flag ${pip_common_args}@${ensure}#egg=${egg_name} || ${pip_install} ${install_args} ${pip_common_args}@${ensure}#egg=${egg_name} ;}",
188184
unless => "${pip_env} freeze --all | grep -i -e ${grep_regex}",
189185
user => $owner,
190-
group => $_group,
186+
group => $group,
191187
umask => $umask,
192188
cwd => $cwd,
193189
environment => $environment,
@@ -199,7 +195,7 @@
199195
command => "${wheel_check} ; { ${pip_install} ${install_args} \$wheel_support_flag ${pip_common_args} || ${pip_install} ${install_args} ${pip_common_args} ;}",
200196
unless => "${pip_env} freeze --all | grep -i -e ${grep_regex}",
201197
user => $owner,
202-
group => $_group,
198+
group => $group,
203199
umask => $umask,
204200
cwd => $cwd,
205201
environment => $environment,
@@ -216,7 +212,7 @@
216212
command => "${wheel_check} ; { ${pip_install} ${install_args} \$wheel_support_flag ${pip_common_args}==${ensure} || ${pip_install} ${install_args} ${pip_common_args}==${ensure} ;}",
217213
unless => "${pip_env} freeze --all | grep -i -e ${grep_regex} || ${pip_env} list | sed -e 's/[ ]\\+/==/' -e 's/[()]//g' | grep -i -e ${grep_regex}",
218214
user => $owner,
219-
group => $_group,
215+
group => $group,
220216
umask => $umask,
221217
cwd => $cwd,
222218
environment => $environment,
@@ -231,7 +227,7 @@
231227
command => "${wheel_check} ; { ${pip_install} \$wheel_support_flag ${pip_common_args} || ${pip_install} ${pip_common_args} ;}",
232228
unless => "${pip_env} freeze --all | grep -i -e ${grep_regex} || ${pip_env} list | sed -e 's/[ ]\\+/==/' -e 's/[()]//g' | grep -i -e ${grep_regex}",
233229
user => $owner,
234-
group => $_group,
230+
group => $group,
235231
umask => $umask,
236232
cwd => $cwd,
237233
environment => $environment,
@@ -262,7 +258,7 @@
262258
command => "${wheel_check} ; { ${pip_install} --upgrade \$wheel_support_flag ${pip_common_args} || ${pip_install} --upgrade ${pip_common_args} ;}",
263259
unless => $unless_command,
264260
user => $owner,
265-
group => $_group,
261+
group => $group,
266262
umask => $umask,
267263
cwd => $cwd,
268264
environment => $environment,
@@ -277,7 +273,7 @@
277273
command => "echo y | ${pip_env} uninstall ${uninstall_args} ${proxy_flag} ${name}",
278274
onlyif => "${pip_env} freeze --all | grep -i -e ${grep_regex}",
279275
user => $owner,
280-
group => $_group,
276+
group => $group,
281277
umask => $umask,
282278
cwd => $cwd,
283279
environment => $environment,

0 commit comments

Comments
 (0)