]> gitweb.fluxo.info Git - puppet-concat.git/commitdiff
Fix use of unqualified variable names
authorChristian G. Warden <cwarden@xerus.org>
Mon, 5 Dec 2011 22:37:18 +0000 (14:37 -0800)
committerChristian G. Warden <cwarden@xerus.org>
Tue, 6 Dec 2011 00:19:24 +0000 (16:19 -0800)
Fully qualify $::id, $::puppetversion, and $::concat_basedir.

manifests/fragment.pp
manifests/init.pp
manifests/setup.pp

index 1fb412894079e92df3a39dd0fae42920c0c7cc8f..97c0d9c8c63c218ecff179437cfd5bcc9ddc9956 100644 (file)
@@ -13,7 +13,7 @@
 #   - group     Owner of the file
 #   - backup    Controls the filebucketing behavior of the final file and
 #               see File type reference for its use.  Defaults to 'puppet'
-define concat::fragment($target, $content='', $source='', $order=10, $ensure = "present", $mode = 0644, $owner = $id, $group = $concat::setup::root_group, $backup = "puppet") {
+define concat::fragment($target, $content='', $source='', $order=10, $ensure = "present", $mode = 0644, $owner = $::id, $group = $concat::setup::root_group, $backup = "puppet") {
     $safe_name = regsubst($name, '/', '_', 'G')
     $safe_target_name = regsubst($target, '/', '_', 'G')
     $concatdir = $concat::setup::concatdir
index 19d91a15d74d13083539bc03aeca7de0d3105c3b..f1fbc9fab93e832d3c5725c1ed8d28bc40709d4a 100644 (file)
@@ -87,7 +87,7 @@
 # ALIASES:
 #  - The exec can notified using Exec["concat_/path/to/file"] or Exec["concat_/path/to/directory"]
 #  - The final file can be referened as File["/path/to/file"] or File["concat_/path/to/file"]  
-define concat($mode = 0644, $owner = $id, $group = $concat::setup::root_group, $warn = "false", $force = "false", $backup = "puppet", $gnu = "true", $order="alpha") {
+define concat($mode = 0644, $owner = $::id, $group = $concat::setup::root_group, $warn = "false", $force = "false", $backup = "puppet", $gnu = "true", $order="alpha") {
     $safe_name   = regsubst($name, '/', '_', 'G')
     $concatdir   = $concat::setup::concatdir
     $version     = $concat::setup::majorversion
@@ -126,7 +126,7 @@ define concat($mode = 0644, $owner = $id, $group = $concat::setup::root_group, $
     }
 
     File{
-        owner  => $id,
+        owner  => $::id,
         group  => $group,
         mode   => $mode,
         backup => $backup
@@ -171,7 +171,7 @@ define concat($mode = 0644, $owner = $id, $group = $concat::setup::root_group, $
         unless    => "${concat::setup::concatdir}/bin/concatfragments.sh -o ${fragdir}/${concat_name} -d ${fragdir} -t ${warnflag} ${forceflag} ${orderflag} ${gnuflag}",
         command   => "${concat::setup::concatdir}/bin/concatfragments.sh -o ${fragdir}/${concat_name} -d ${fragdir} ${warnflag} ${forceflag} ${orderflag} ${gnuflag}",
     }
-    if $id == 'root' {
+    if $::id == 'root' {
       Exec["concat_${name}"]{
         user      => root,
         group     => $group,
index 53092ab032ff6c1a3a6294732b69ecfce2ec40f0..2c1d34396dc470f792bfd98015c437cb9377780f 100644 (file)
 #
 # It also copies out the concatfragments.sh file to /usr/local/bin
 class concat::setup {
+    $id = $::id
     $root_group = $id ? {
       root => 0,
       default => $id
     }
-    $concatdir = $concat_basedir
-    $majorversion = regsubst($puppetversion, '^[0-9]+[.]([0-9]+)[.][0-9]+$', '\1')
+    $concatdir = $::concat_basedir
+    $majorversion = regsubst($::puppetversion, '^[0-9]+[.]([0-9]+)[.][0-9]+$', '\1')
 
     file{"${concatdir}/bin/concatfragments.sh":
             owner  => $id,