From 36bccce61338d7891f6809bb92eea9fd76e3ac18 Mon Sep 17 00:00:00 2001 From: Aleksey Timohin Date: Tue, 3 Sep 2013 16:46:36 +0200 Subject: [PATCH 1/2] fixed #1: fixed puppet-lint formatting warnings --- manifests/init.pp | 100 +++++++++--------- .../manifests/init.pp | 100 +++++++++--------- 2 files changed, 100 insertions(+), 100 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index c0ec4f5..bf5f356 100755 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -16,30 +16,30 @@ # - execrecursive: as an alternative to using the recurse method for file ownership this just does chmod and chown -- it is much faster than the recurse method (Default true) define fetchfile( - $downloadurl=undef, - $downloadfile=undef, - $downloadto=undef, - $compression='tar.gz', - $desintationpath=undef, - $destinationfile=undef, - $owner='root', - $group='root', - $mode='775', - $recurse=false, - $execrecurse=true + $downloadurl=undef, + $downloadfile=undef, + $downloadto=undef, + $compression='tar.gz', + $desintationpath=undef, + $destinationfile=undef, + $owner='root', + $group='root', + $mode='775', + $recurse=false, + $execrecurse=true ) { - + # common things for exec - $execlaunchpaths = ["/usr/bin", "/usr/sbin", "/bin", "/sbin", "/etc"] - $executefrom = "/tmp/" - + $execlaunchpaths = ['/usr/bin', '/usr/sbin', '/bin', '/sbin', '/etc'] + $executefrom = '/tmp/' + # creates tests for commandline execution $wgetcreates = "${downloadto}${downloadfile}" - + # destination creates $destinationcreates = "${desintationpath}${destinationfile}" - - # commands to be run by exec + + # commands to be run by exec $wgetcommand ="wget -O '${wgetcreates}' '${downloadurl}'" $chowncommand = "chown -R ${owner}:${group} ${destinationcreates}" $chmodcommand = "chmod -R ${mode} ${destinationcreates}" @@ -59,48 +59,48 @@ # downloads file exec {"${name}_fetchfiledownload": - command=>$wgetcommand, - cwd=> $executefrom, - path=> $execlaunchpaths, - creates=>$wgetcreates, - logoutput=> on_failure, + command => $wgetcommand, + cwd => $executefrom, + path => $execlaunchpaths, + creates => $wgetcreates, + logoutput => on_failure, } # make destination file exec {"${name}_fetchfiledecompress": - command=>$destinationcommand, - cwd=> $executefrom, - path=> $execlaunchpaths, - creates=>$destinationcreates, - logoutput=> on_failure, - require=>exec["${name}_fetchfiledownload"] + command => $destinationcommand, + cwd => $executefrom, + path => $execlaunchpaths, + creates => $destinationcreates, + logoutput => on_failure, + require => exec["${name}_fetchfiledownload"] } - + # Mod file file {"${name}_fetchfiledecompress": - path=>$destinationcreates, - owner=>$owner, - group=>$group, - mode=>$mode, - recurse=>$recurse, - require=>exec["${name}_fetchfiledecompress"] + path => $destinationcreates, + owner => $owner, + group => $group, + mode => $mode, + recurse => $recurse, + require => exec["${name}_fetchfiledecompress"] } - + if $execrecurse == true { exec {"${name}_chmoddestinationfile": - command=>$chmodcommand, - cwd=> $executefrom, - path=> $execlaunchpaths, - logoutput=> on_failure, - require=>file["${name}_fetchfiledecompress"] - } - - exec {"${name}_chowndestinationfile": - command=>$chowncommand, - cwd=> $executefrom, - path=> $execlaunchpaths, - logoutput=> on_failure, - require=>file["${name}_fetchfiledecompress"] + command => $chmodcommand, + cwd => $executefrom, + path => $execlaunchpaths, + logoutput => on_failure, + require => file["${name}_fetchfiledecompress"] + } + + exec {"${name}_chowndestinationfile": + command => $chowncommand, + cwd => $executefrom, + path => $execlaunchpaths, + logoutput => on_failure, + require => file["${name}_fetchfiledecompress"] } } } diff --git a/pkg/runthebusiness-fetchfile-1.0.0/manifests/init.pp b/pkg/runthebusiness-fetchfile-1.0.0/manifests/init.pp index c0ec4f5..bf5f356 100755 --- a/pkg/runthebusiness-fetchfile-1.0.0/manifests/init.pp +++ b/pkg/runthebusiness-fetchfile-1.0.0/manifests/init.pp @@ -16,30 +16,30 @@ # - execrecursive: as an alternative to using the recurse method for file ownership this just does chmod and chown -- it is much faster than the recurse method (Default true) define fetchfile( - $downloadurl=undef, - $downloadfile=undef, - $downloadto=undef, - $compression='tar.gz', - $desintationpath=undef, - $destinationfile=undef, - $owner='root', - $group='root', - $mode='775', - $recurse=false, - $execrecurse=true + $downloadurl=undef, + $downloadfile=undef, + $downloadto=undef, + $compression='tar.gz', + $desintationpath=undef, + $destinationfile=undef, + $owner='root', + $group='root', + $mode='775', + $recurse=false, + $execrecurse=true ) { - + # common things for exec - $execlaunchpaths = ["/usr/bin", "/usr/sbin", "/bin", "/sbin", "/etc"] - $executefrom = "/tmp/" - + $execlaunchpaths = ['/usr/bin', '/usr/sbin', '/bin', '/sbin', '/etc'] + $executefrom = '/tmp/' + # creates tests for commandline execution $wgetcreates = "${downloadto}${downloadfile}" - + # destination creates $destinationcreates = "${desintationpath}${destinationfile}" - - # commands to be run by exec + + # commands to be run by exec $wgetcommand ="wget -O '${wgetcreates}' '${downloadurl}'" $chowncommand = "chown -R ${owner}:${group} ${destinationcreates}" $chmodcommand = "chmod -R ${mode} ${destinationcreates}" @@ -59,48 +59,48 @@ # downloads file exec {"${name}_fetchfiledownload": - command=>$wgetcommand, - cwd=> $executefrom, - path=> $execlaunchpaths, - creates=>$wgetcreates, - logoutput=> on_failure, + command => $wgetcommand, + cwd => $executefrom, + path => $execlaunchpaths, + creates => $wgetcreates, + logoutput => on_failure, } # make destination file exec {"${name}_fetchfiledecompress": - command=>$destinationcommand, - cwd=> $executefrom, - path=> $execlaunchpaths, - creates=>$destinationcreates, - logoutput=> on_failure, - require=>exec["${name}_fetchfiledownload"] + command => $destinationcommand, + cwd => $executefrom, + path => $execlaunchpaths, + creates => $destinationcreates, + logoutput => on_failure, + require => exec["${name}_fetchfiledownload"] } - + # Mod file file {"${name}_fetchfiledecompress": - path=>$destinationcreates, - owner=>$owner, - group=>$group, - mode=>$mode, - recurse=>$recurse, - require=>exec["${name}_fetchfiledecompress"] + path => $destinationcreates, + owner => $owner, + group => $group, + mode => $mode, + recurse => $recurse, + require => exec["${name}_fetchfiledecompress"] } - + if $execrecurse == true { exec {"${name}_chmoddestinationfile": - command=>$chmodcommand, - cwd=> $executefrom, - path=> $execlaunchpaths, - logoutput=> on_failure, - require=>file["${name}_fetchfiledecompress"] - } - - exec {"${name}_chowndestinationfile": - command=>$chowncommand, - cwd=> $executefrom, - path=> $execlaunchpaths, - logoutput=> on_failure, - require=>file["${name}_fetchfiledecompress"] + command => $chmodcommand, + cwd => $executefrom, + path => $execlaunchpaths, + logoutput => on_failure, + require => file["${name}_fetchfiledecompress"] + } + + exec {"${name}_chowndestinationfile": + command => $chowncommand, + cwd => $executefrom, + path => $execlaunchpaths, + logoutput => on_failure, + require => file["${name}_fetchfiledecompress"] } } } From 3a5a5b26592c38f72219495585d9493add705ff4 Mon Sep 17 00:00:00 2001 From: Aleksey Timohin Date: Tue, 3 Sep 2013 16:59:41 +0200 Subject: [PATCH 2/2] fixed deprecation warnings: Warning: Deprecation notice: Resource references should now be capitalized --- manifests/init.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index bf5f356..5a057c1 100755 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -73,7 +73,7 @@ path => $execlaunchpaths, creates => $destinationcreates, logoutput => on_failure, - require => exec["${name}_fetchfiledownload"] + require => Exec["${name}_fetchfiledownload"] } # Mod file @@ -83,7 +83,7 @@ group => $group, mode => $mode, recurse => $recurse, - require => exec["${name}_fetchfiledecompress"] + require => Exec["${name}_fetchfiledecompress"] } if $execrecurse == true { @@ -92,7 +92,7 @@ cwd => $executefrom, path => $execlaunchpaths, logoutput => on_failure, - require => file["${name}_fetchfiledecompress"] + require => File["${name}_fetchfiledecompress"] } exec {"${name}_chowndestinationfile": @@ -100,7 +100,7 @@ cwd => $executefrom, path => $execlaunchpaths, logoutput => on_failure, - require => file["${name}_fetchfiledecompress"] + require => File["${name}_fetchfiledecompress"] } } }