Skip to content

Commit

Permalink
Merge branch '2.6.x' into next
Browse files Browse the repository at this point in the history
* 2.6.x:
  (#5908) Add support for new update-rc.d disable API
  (#6862) Add a default subject for the mail_patches rake task
  Fixed #6256 - Creation of rrd directory.
  • Loading branch information
Max Martin committed Mar 30, 2011
2 parents 9290b2f + 9d17809 commit 11309a2
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/puppet/application/master.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def setup

exit(Puppet.settings.print_configs ? 0 : 1) if Puppet.settings.print_configs?

Puppet.settings.use :main, :master, :ssl
Puppet.settings.use :main, :master, :ssl, :metrics

# Cache our nodes in yaml. Currently not configurable.
Puppet::Node.indirection.cache_class = :yaml
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ module Puppet

setdefaults(:metrics,
:rrddir => {:default => "$vardir/rrd",
:mode => 0750,
:owner => "service",
:group => "service",
:desc => "The directory where RRD database files are stored.
Expand Down
8 changes: 6 additions & 2 deletions lib/puppet/provider/service/debian.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ def self.defpath

# Remove the symlinks
def disable
update_rc "-f", @resource[:name], "remove"
update_rc @resource[:name], "stop", "00", "1", "2", "3", "4", "5", "6", "."
if `dpkg --compare-versions $(dpkg-query -W --showformat '${Version}' sysv-rc) ge 2.88 ; echo $?`.to_i == 0
update_rc @resource[:name], "disable"
else
update_rc "-f", @resource[:name], "remove"
update_rc @resource[:name], "stop", "00", "1", "2", "3", "4", "5", "6", "."
end
end

def enabled?
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/application/master_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@
lambda { @master.setup }.should raise_error(SystemExit)
end

it "should tell Puppet.settings to use :main,:ssl and :master category" do
Puppet.settings.expects(:use).with(:main,:master,:ssl)
it "should tell Puppet.settings to use :main,:ssl,:master and :metrics category" do
Puppet.settings.expects(:use).with(:main,:master,:ssl,:metrics)

@master.setup
end
Expand Down
16 changes: 14 additions & 2 deletions spec/unit/provider/service/debian_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,20 @@
end

describe "when disabling" do
it "should call update-rc.d twice" do
@provider.expects(:update_rc).twice
it "should be able to disable services with newer sysv-rc versions" do
@provider.stubs(:`).with("dpkg --compare-versions $(dpkg-query -W --showformat '${Version}' sysv-rc) ge 2.88 ; echo $?").returns "0"

@provider.expects(:update_rc).with(@resource[:name], "disable")

@provider.disable
end

it "should be able to enable services with older sysv-rc versions" do
@provider.stubs(:`).with("dpkg --compare-versions $(dpkg-query -W --showformat '${Version}' sysv-rc) ge 2.88 ; echo $?").returns "1"

@provider.expects(:update_rc).with("-f", @resource[:name], "remove")
@provider.expects(:update_rc).with(@resource[:name], "stop", "00", "1", "2", "3", "4", "5", "6", ".")

@provider.disable
end
end
Expand Down
4 changes: 3 additions & 1 deletion tasks/rake/git_workflow.rake
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ task :mail_patches do
# If we've got more than one patch, add --compose
if files.length > 1
compose = "--compose"
subject = "--subject \"#{type} #{name} against #{parent}\""
else
compose = ""
subject = ""
end

# Now send the mail.
sh "git send-email #{compose} --no-signed-off-by-cc --suppress-from --to puppet-dev@googlegroups.com 00*.patch"
sh "git send-email #{compose} #{subject} --no-signed-off-by-cc --suppress-from --to puppet-dev@googlegroups.com 00*.patch"

# Finally, clean up the patches
sh "rm 00*.patch"
Expand Down

0 comments on commit 11309a2

Please sign in to comment.