Skip to content

Commit

Permalink
updated to use supervisord::executable_ctl varialbe for supervisorctl…
Browse files Browse the repository at this point in the history
… commands
  • Loading branch information
Alex Crowe committed May 3, 2014
1 parent 5da2f16 commit 0a5ffc5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
$init_defaults = $supervisord::params::init_defaults,
$setuptools_url = $supervisord::params::setuptools_url,
$executable = $supervisord::params::executable,
$executable_ctl = $supervisord::params::executable_ctl,

$log_path = $supervisord::params::log_path,
$log_file = $supervisord::params::log_file,
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
$service_ensure = 'running'
$package_name = 'supervisor'
$executable = '/usr/local/bin/supervisord'
$executable_ctl = '/usr/local/bin/supervisorctl'

$run_path = '/var/run'
$pid_file = 'supervisord.pid'
Expand Down
2 changes: 1 addition & 1 deletion manifests/reload.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
class supervisord::reload {

$supervisorctl = $::supervisord::executable
$supervisorctl = $::supervisord::executable_ctl

exec { 'supervisorctl_reread':
command => "${supervisorctl} reread",
Expand Down
5 changes: 3 additions & 2 deletions manifests/supervisorctl.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
define supervisord::supervisorctl(
$command,
$process = undef,
$refreshonly = false,
$supervisorctl = '/usr/local/bin/supervisorctl'
$refreshonly = false
) {

validate_string($command)
validate_string($process)

$supervisorctl = $::supervisord::executable_ctl

if $process {
$cmd = join([$supervisorctl, $command, $process], ' ')
}
Expand Down
6 changes: 3 additions & 3 deletions spec/acceptance/supervisord_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class { 'supervisord': install_pip => true, install_init => true}
pp = <<-EOS
include supervisord
supervisord::group { 'test':
programs => ['program1', 'program2'],
programs => ['test'],
priority => '100',
}
EOS
Expand All @@ -105,9 +105,9 @@ class { 'supervisord': install_pip => true, install_init => true}
end

it 'should contain the correct values' do
cmd='grep "programs=program1,program2" /etc/supervisor.d/group_test.conf'
cmd='grep "programs=test" /etc/supervisor.d/group_test.conf'
expect(shell(cmd).exit_code).to eq(0)
cmd="grep priority=100 /etc/supervisor.d/fcgi-program_test.conf"
cmd="grep priority=100 /etc/supervisor.d/group_test.conf"
expect(shell(cmd).exit_code).to eq(0)
end
end
Expand Down

0 comments on commit 0a5ffc5

Please sign in to comment.