Skip to content

Commit 5081a15

Browse files
committed
Merge branch 'master' into ctennis/chef-213
2 parents 4b230eb + 967d48d commit 5081a15

3 files changed

Lines changed: 29 additions & 4 deletions

File tree

chef-server-slice/lib/chef-server-slice.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,13 @@ def self.setup_router(scope)
8181

8282
scope.match("/status").to(:controller => "status", :action => "index").name(:status)
8383

84-
scope.resources :searches, :path => "search", :controller => "search" do
85-
scope.resources :entries, :controller => "search_entries"
86-
end
84+
scope.resources :searches, :path => "search", :controller => "search"
85+
scope.match("/search/:search_id/entries", :method => 'get').to(:controller => "search_entries", :action => "index")
86+
scope.match("/search/:search_id/entries", :method => 'post').to(:controller => "search_entries", :action => "create")
87+
scope.match("/search/:search_id/entries/:id", :method => 'get').to(:controller => "search_entries", :action => "show")
88+
scope.match("/search/:search_id/entries/:id", :method => 'put').to(:controller => "search_entries", :action => "create")
89+
scope.match("/search/:search_id/entries/:id", :method => 'post').to(:controller => "search_entries", :action => "update")
90+
scope.match("/search/:search_id/entries/:id", :method => 'delete').to(:controller => "search_entries", :action => "destroy")
8791

8892
scope.match("/cookbooks/_attribute_files").to(:controller => "cookbooks", :action => "attribute_files")
8993
scope.match("/cookbooks/_recipe_files").to(:controller => "cookbooks", :action => "recipe_files")

chef/lib/chef/provider/service/gentoo.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ class Provider
2424
class Service
2525
class Gentoo < Chef::Provider::Service::Init
2626
def load_current_resource
27+
28+
@new_resource.supports[:status] = true
29+
@new_resource.supports[:restart] = true
30+
2731
super
2832

2933
raise Chef::Exceptions::Service unless ::File.exists?("/sbin/rc-update")

chef/spec/unit/provider/service/gentoo_service_spec.rb

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
before(:each) do
2323
@node = mock("Chef::Node", :null_object => true)
2424

25-
resource_opts = { :null_object => true, :name => 'chef', :service_name => 'chef', :enabled => false, :running => nil }
25+
resource_opts = { :null_object => true, :name => 'chef', :service_name => 'chef', :enabled => false, :running => nil, :supports => {} }
2626
@new_resource = mock("Chef::Resource::Service", resource_opts)
2727
@current_resource = mock("Chef::Resource::Service", resource_opts)
2828

@@ -70,6 +70,22 @@
7070
it "should return the current_resource" do
7171
@provider.load_current_resource.should == @current_resource
7272
end
73+
74+
it "should support the status command automatically" do
75+
@provider.load_current_resource
76+
@new_resource.supports[:status].should be_true
77+
end
78+
79+
it "should support the restart command automatically" do
80+
@provider.load_current_resource
81+
@new_resource.supports[:restart].should be_true
82+
end
83+
84+
it "should not support the reload command automatically" do
85+
@provider.load_current_resource
86+
@new_resource.supports[:reload].should_not be_true
87+
end
88+
7389
end
7490

7591
describe "action_methods" do
@@ -89,4 +105,5 @@
89105
end
90106
end
91107
end
108+
92109
end

0 commit comments

Comments
 (0)