Skip to content

Commit 8e13f67

Browse files
committed
Improved code quality
1 parent 3ef7fdf commit 8e13f67

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

manifests/install.pp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@
1515
present, installed: {
1616
$index_url_arg = $index_url ? {
1717
undef => '',
18-
defaults => "--index_url=$index_url",
18+
defaults => "--index_url=${index_url}",
1919
}
2020

2121
if $version != undef {
22-
$package_with_version = "$package==$version"
23-
$grep_for = "^$package_with_version$"
22+
$package_with_version = "${package}==${version}"
23+
$grep_for = "^${package_with_version}$"
2424
} else {
2525
$package_with_version = $package
26-
$grep_for = "^$package=="
26+
$grep_for = "^${package}=="
2727
}
2828

29-
exec { "install-$package":
30-
command => "pip$python_version install $index_url_arg $package_with_version",
31-
unless => "pip$python_version freeze | grep '$grep_for'",
29+
exec { "install-${package}":
30+
command => "pip${python_version} install ${index_url_arg} ${package_with_version}",
31+
unless => "pip${python_version} freeze | grep '${grep_for}'",
3232
}
3333
}
3434

@@ -38,9 +38,9 @@
3838
}
3939

4040
absent, purged: {
41-
exec { "uninstall-$package":
42-
command => "pip$python_version uninstall $package -y",
43-
onlyif => "pip$python_version freeze | cut -d= -f1 | egrep '^$package$'",
41+
exec { "uninstall-${package}":
42+
command => "pip${python_version} uninstall ${package} -y",
43+
onlyif => "pip${python_version} freeze | cut -d= -f1 | egrep '^${package}$'",
4444
}
4545
}
4646
}

manifests/installation.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
require => Package['curl'],
1111
}
1212

13-
exec { "install-pip$python_version":
14-
command => "curl -L $get_pip_url | python$python_version",
15-
unless => "which pip$python_version",
16-
onlyif => "which python$python_version",
13+
exec { "install-pip${python_version}":
14+
command => "curl -L ${get_pip_url} | python${python_version}",
15+
unless => "which pip${python_version}",
16+
onlyif => "which python${python_version}",
1717
}
1818

1919
}

0 commit comments

Comments
 (0)