Skip to content

Commit 51de87b

Browse files
committed
puppet-lint: autofix
1 parent dbbd4a4 commit 51de87b

11 files changed

Lines changed: 25 additions & 36 deletions

File tree

manifests/config.pp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# include python::config
66
#
77
class python::config {
8-
98
Class['python::install'] -> Python::Pip <| |>
109
Class['python::install'] -> Python::Requirements <| |>
1110
Class['python::install'] -> Python::Virtualenv <| |>
@@ -27,5 +26,4 @@
2726
}
2827
}
2928
}
30-
3129
}

manifests/dotfile.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
exec { "create ${title}'s parent dir":
3636
command => "install -o ${owner} -g ${group} -d ${parent_dir}",
37-
path => [ '/usr/bin', '/bin', '/usr/local/bin', ],
37+
path => ['/usr/bin', '/bin', '/usr/local/bin',],
3838
creates => $parent_dir,
3939
}
4040

manifests/gunicorn.pp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,4 @@
7979
content => template($template),
8080
}
8181
}
82-
8382
}

manifests/init.pp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,32 +49,31 @@
4949
$gunicorn_package_name = $python::params::gunicorn_package_name,
5050
Optional[Enum['pip', 'scl', 'rhscl', 'anaconda', '']] $provider = $python::params::provider,
5151
$valid_versions = $python::params::valid_versions,
52-
Hash $python_pips = { },
53-
Hash $python_virtualenvs = { },
54-
Hash $python_pyvenvs = { },
55-
Hash $python_requirements = { },
56-
Hash $python_dotfiles = { },
52+
Hash $python_pips = {},
53+
Hash $python_virtualenvs = {},
54+
Hash $python_pyvenvs = {},
55+
Hash $python_requirements = {},
56+
Hash $python_dotfiles = {},
5757
Boolean $use_epel = $python::params::use_epel,
5858
$rhscl_use_public_repository = $python::params::rhscl_use_public_repository,
5959
Stdlib::Httpurl $anaconda_installer_url = $python::params::anaconda_installer_url,
6060
Stdlib::Absolutepath $anaconda_install_path = $python::params::anaconda_install_path,
6161
Boolean $manage_scl = $python::params::manage_scl,
6262
Optional[Pattern[/[0-7]{1,4}/]] $umask = undef,
6363
) inherits python::params {
64-
6564
$exec_prefix = $provider ? {
6665
'scl' => "/usr/bin/scl enable ${version} -- ",
6766
'rhscl' => "/usr/bin/scl enable ${version} -- ",
6867
default => '',
6968
}
7069

7170
unless $version =~ Pattern[/\A(python)?[0-9](\.?[0-9])*/,
72-
/\Apypy\Z/, /\Asystem\Z/, /\Arh-python[0-9]{2}(?:-python)?\Z/] {
71+
/\Apypy\Z/, /\Asystem\Z/, /\Arh-python[0-9]{2}(?:-python)?\Z/] {
7372
fail("version needs to be pypy, system or a version string like '36', '3.6' or 'python3.6' )")
7473
}
7574

7675
# Module compatibility check
77-
$compatible = [ 'Debian', 'RedHat', 'Suse', 'Gentoo', 'AIX' ]
76+
$compatible = ['Debian', 'RedHat', 'Suse', 'Gentoo', 'AIX']
7877
if ! ($facts['os']['family'] in $compatible) {
7978
fail("Module is not compatible with ${facts['os']['name']}")
8079
}
@@ -96,5 +95,4 @@
9695
create_resources('python::virtualenv', $python_virtualenvs)
9796
create_resources('python::requirements', $python_requirements)
9897
create_resources('python::dotfile', $python_dotfiles)
99-
10098
}

manifests/install.pp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# include python::install
66
#
77
class python::install {
8-
98
$python = $python::version ? {
109
'system' => 'python',
1110
'pypy' => 'pypy',
@@ -67,7 +66,6 @@
6766

6867
case $python::provider {
6968
'pip': {
70-
7169
if $python::manage_pip_package {
7270
package { 'pip':
7371
ensure => $pip_ensure,
@@ -208,7 +206,7 @@
208206
'AIX': {
209207
if String($python::version) =~ /^python3/ {
210208
class { 'python::pip::bootstrap':
211-
version => 'pip3',
209+
version => 'pip3',
212210
}
213211
} else {
214212
if $python::manage_pip_package {
@@ -227,7 +225,6 @@
227225
provider => 'yum',
228226
}
229227
}
230-
231228
}
232229
default: {
233230
if $python::manage_pip_package {
@@ -243,7 +240,6 @@
243240
alias => $pythondev,
244241
}
245242
}
246-
247243
}
248244
}
249245

manifests/params.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
}
3535

3636
$pip_lookup_path = $facts['os']['family'] ? {
37-
'AIX' => [ '/bin', '/usr/bin', '/usr/local/bin', '/opt/freeware/bin/' ],
38-
default => [ '/bin', '/usr/bin', '/usr/local/bin' ]
37+
'AIX' => ['/bin', '/usr/bin', '/usr/local/bin', '/opt/freeware/bin/'],
38+
default => ['/bin', '/usr/bin', '/usr/local/bin']
3939
}
4040

4141
$gunicorn_package_name = $facts['os']['family'] ? {

manifests/pip.pp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
String[1] $log_dir = '/tmp',
6969
Array[String] $path = ['/usr/local/bin','/usr/bin','/bin', '/usr/sbin'],
7070
String[1] $exec_provider = 'shell',
71-
){
71+
) {
7272
$python_provider = getparam(Class['python'], 'provider')
7373
$python_version = getparam(Class['python'], 'version')
7474

@@ -111,9 +111,9 @@
111111
}
112112

113113
$pypi_index = $index ? {
114-
false => '',
115-
default => "--index-url=${index}",
116-
}
114+
false => '',
115+
default => "--index-url=${index}",
116+
}
117117

118118
$proxy_flag = $proxy ? {
119119
undef => '',
@@ -204,15 +204,15 @@
204204
# Note: we DO need to repeat ourselves with "from version" in both grep and sed as on some systems pip returns
205205
# more than one line with paretheses.
206206
$latest_version = join(["${pip_install} ${pypi_index} ${proxy_flag} ${install_args} ${install_editable} ${real_pkgname}==notreallyaversion 2>&1",
207-
' | grep -oP "\(from versions: .*\)" | sed -E "s/\(from versions: (.*?, )*(.*)\)/\2/g"',
208-
' | tr -d "[:space:]"'])
207+
' | grep -oP "\(from versions: .*\)" | sed -E "s/\(from versions: (.*?, )*(.*)\)/\2/g"',
208+
' | tr -d "[:space:]"'])
209209

210210
# Packages with underscores in their names are listed with dashes in their place in `pip freeze` output
211211
$pkgname_with_dashes = regsubst($real_pkgname, '_', '-', 'G')
212212
$grep_regex_pkgname_with_dashes = "^${pkgname_with_dashes}=="
213213
$installed_version = join(["${pip_env} freeze --all",
214-
" | grep -i -e ${grep_regex_pkgname_with_dashes} | cut -d= -f3",
215-
" | tr -d '[:space:]'"])
214+
" | grep -i -e ${grep_regex_pkgname_with_dashes} | cut -d= -f3",
215+
" | tr -d '[:space:]'"])
216216

217217
$command = "${pip_install} --upgrade ${pip_common_args}"
218218
$unless_command = "[ \$(${latest_version}) = \$(${installed_version}) ]"
@@ -243,5 +243,4 @@
243243
path => $_path,
244244
provider => $exec_provider,
245245
}
246-
247246
}

manifests/pip/bootstrap.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
$environ = $http_proxy ? {
2727
undef => [],
2828
default => $facts['os']['family'] ? {
29-
'AIX' => [ "http_proxy=${http_proxy}", "https_proxy=${http_proxy}" ],
30-
default => [ "HTTP_PROXY=${http_proxy}", "HTTPS_PROXY=${http_proxy}" ],
29+
'AIX' => ["http_proxy=${http_proxy}", "https_proxy=${http_proxy}"],
30+
default => ["HTTP_PROXY=${http_proxy}", "HTTPS_PROXY=${http_proxy}"],
3131
}
3232
}
3333

manifests/pyvenv.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
$owner = 'root',
3030
$group = 'root',
3131
$mode = '0755',
32-
$path = [ '/bin', '/usr/bin', '/usr/sbin', '/usr/local/bin' ],
32+
$path = ['/bin', '/usr/bin', '/usr/sbin', '/usr/local/bin'],
3333
$environment = [],
3434
) {
3535
include python
@@ -44,7 +44,7 @@
4444
$normalized_python_version = sprintf('%s.%s', $python_version_parts[0], $python_version_parts[1])
4545

4646
# Debian splits the venv module into a seperate package
47-
if ( $facts['os']['family'] == 'Debian'){
47+
if ( $facts['os']['family'] == 'Debian') {
4848
$python3_venv_package="python${normalized_python_version}-venv"
4949
case $facts['os']['distro']['codename'] {
5050
'xenial','bionic','cosmic','disco',

manifests/requirements.pp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
$log_dir = '/tmp',
4343
$timeout = 1800,
4444
) {
45-
4645
include python
4746

4847
if $virtualenv == 'system' and ($owner != 'root' or $group != 'root') {
@@ -81,7 +80,7 @@
8180
# the same requirements file.
8281
if !defined(File[$requirements]) and $manage_requirements == true {
8382
file { $requirements:
84-
ensure => present,
83+
ensure => file,
8584
mode => '0644',
8685
owner => $owner_real,
8786
group => $group_real,

0 commit comments

Comments
 (0)