Permalink
Browse files

16290 - Remove bin directories from plugin packager

In the past bin directories were added to packages
created by the plugin packager.

Bin directories are no longer packaged by the plugin
packager.
  • Loading branch information...
1 parent 3337bd1 commit 8712304064bb398e2c87d4b6bc56581e9346c45b @ploubser ploubser committed with ripienaar Sep 7, 2012
View
2 lib/mcollective/pluginpackager/agent_definition.rb
@@ -59,11 +59,9 @@ def client
:description => "Client plugin for #{@metadata[:name]}"}
clientdir = File.join(@path, "application")
- bindir = File.join(@path, "bin")
aggregatedir = File.join(@path, "aggregate")
client[:files] += Dir.glob(File.join(clientdir, "*")) if PluginPackager.check_dir_present clientdir
- client[:files] += Dir.glob(File.join(bindir,"*")) if PluginPackager.check_dir_present bindir
client[:files] += Dir.glob(File.join(aggregatedir, "*")) if PluginPackager.check_dir_present aggregatedir
client[:dependencies] << {:name => "#{@mcname}-#{@metadata[:name]}-common", :version => @metadata[:version]}
client[:files].empty? ? nil : client
View
13 spec/unit/pluginpackager/agent_definition_spec.rb
@@ -120,40 +120,35 @@ module PluginPackager
before do
AgentDefinition.any_instance.expects(:agent).returns(nil)
File.expects(:join).with(".", "application").returns("clientdir")
- File.expects(:join).with(".", "bin").returns("bindir")
File.expects(:join).with(".", "aggregate").returns("aggregatedir")
end
it "should populate client files if all directories are present" do
AgentDefinition.any_instance.expects(:common).returns(nil)
- PluginPackager.expects(:check_dir_present).times(3).returns(true)
+ PluginPackager.expects(:check_dir_present).times(2).returns(true)
File.expects(:join).with("clientdir", "*").returns("clientdir/*")
- File.expects(:join).with("bindir", "*").returns("bindir/*")
File.expects(:join).with("aggregatedir", "*").returns("aggregatedir/*")
Dir.expects(:glob).with("clientdir/*").returns(["client.rb"])
- Dir.expects(:glob).with("bindir/*").returns(["bin.rb"])
Dir.expects(:glob).with("aggregatedir/*").returns(["aggregate.rb"])
client = AgentDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "agent")
- client.packagedata[:client][:files].should == ["client.rb", "bin.rb", "aggregate.rb"]
+ client.packagedata[:client][:files].should == ["client.rb", "aggregate.rb"]
end
it "should not populate client files if directories are not present" do
AgentDefinition.any_instance.expects(:common).returns(nil)
- PluginPackager.expects(:check_dir_present).times(3).returns(false)
+ PluginPackager.expects(:check_dir_present).times(2).returns(false)
client = AgentDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "agent")
client.packagedata[:client].should == nil
end
it "should add common package as dependency if present" do
AgentDefinition.any_instance.expects(:common).returns("common")
- PluginPackager.expects(:check_dir_present).times(3).returns(true)
+ PluginPackager.expects(:check_dir_present).times(2).returns(true)
File.expects(:join).with("clientdir", "*").returns("clientdir/*")
- File.expects(:join).with("bindir", "*").returns("bindir/*")
File.expects(:join).with("aggregatedir", "*").returns("aggregatedir/*")
Dir.expects(:glob).with("clientdir/*").returns(["client.rb"])
- Dir.expects(:glob).with("bindir/*").returns(["bin.rb"])
Dir.expects(:glob).with("aggregatedir/*").returns(["aggregate.rb"])
client = AgentDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "agent")

0 comments on commit 8712304

Please sign in to comment.