Skip to content

Commit

Permalink
Remove shell script
Browse files Browse the repository at this point in the history
The ruby script works just as well and works on all supported platforms. No need to maintain both.
  • Loading branch information
Morgan Haskel committed Feb 13, 2015
1 parent 20d0a5f commit 7eb14b7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 157 deletions.
140 changes: 0 additions & 140 deletions files/concatfragments.sh

This file was deleted.

4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#
# === Actions:
# * Creates fragment directories if it didn't exist already
# * Executes the concatfragments.sh script to build the final file, this
# * Executes the concatfragments.rb script to build the final file, this
# script will create directory/fragments.concat. Execution happens only
# when:
# * The directory changes
Expand Down Expand Up @@ -210,7 +210,7 @@
}

# if puppet is running as root, this exec should also run as root to allow
# the concatfragments.sh script to potentially be installed in path that
# the concatfragments.rb script to potentially be installed in path that
# may not be accessible by a target non-root owner.
exec { "concat_${name}":
alias => "concat_${fragdir}",
Expand Down
10 changes: 1 addition & 9 deletions manifests/setup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,7 @@
$fragment_owner = $::osfamily ? { 'windows' => undef, default => $::id }
$fragment_mode = $::osfamily ? { 'windows' => undef, default => '0640' }

# PR #174 introduced changes to the concatfragments.sh script that are
# incompatible with Solaris 10 but reportedly OK on Solaris 11. As a work
# around we are enable the .rb concat script on all Solaris versions. If
# this goes smoothly, we should move towards completely eliminating the .sh
# version.
$script_name = $::osfamily? {
/(?i:(Windows|Solaris|AIX))/ => 'concatfragments.rb',
default => 'concatfragments.sh'
}
$script_name = 'concatfragments.rb'

$script_path = "${concatdir}/bin/${script_name}"

Expand Down
6 changes: 3 additions & 3 deletions spec/acceptance/concat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
when 'AIX'
username = 'root'
groupname = 'system'
scriptname = 'concatfragments.sh'
scriptname = 'concatfragments.rb'
vardir = default['puppetvardir']
when 'Darwin'
username = 'root'
groupname = 'wheel'
scriptname = 'concatfragments.sh'
scriptname = 'concatfragments.rb'
vardir = default['puppetvardir']
when 'windows'
username = 'Administrator'
Expand All @@ -25,7 +25,7 @@
else
username = 'root'
groupname = 'root'
scriptname = 'concatfragments.sh'
scriptname = 'concatfragments.rb'
vardir = default['puppetvardir']
end

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/classes/concat_setup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
end

it do
should contain_file("#{concatdir}/bin/concatfragments.sh").with({
should contain_file("#{concatdir}/bin/concatfragments.rb").with({
:mode => '0755',
:source => 'puppet:///modules/concat/concatfragments.sh',
:source => 'puppet:///modules/concat/concatfragments.rb',
:backup => false,
})
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/defines/concat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
}))
end

cmd = "#{concatdir}/bin/concatfragments.sh " +
cmd = "#{concatdir}/bin/concatfragments.rb " +
"-o \"#{concatdir}/#{safe_name}/fragments.concat.out\" " +
"-d \"#{concatdir}/#{safe_name}\""

Expand Down

0 comments on commit 7eb14b7

Please sign in to comment.