Skip to content

Commit

Permalink
Merge pull request #73 from s-bernard/config-policy
Browse files Browse the repository at this point in the history
Can specify repository policy
  • Loading branch information
KAllan357 committed Mar 10, 2014
2 parents 24d7bf6 + 05c75b3 commit f2ad702
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion providers/hosted_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def load_current_resource

action :create do
unless repository_exists?(@current_resource.name)
Chef::Nexus.nexus(node).create_repository(new_resource.name, false, nil, nil, nil, nil)
Chef::Nexus.nexus(node).create_repository(new_resource.name, false, nil, nil, new_resource.policy, nil)
set_publisher if new_resource.publisher
new_resource.updated_by_last_action(true)
end
Expand Down
2 changes: 1 addition & 1 deletion providers/proxy_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def load_current_resource

action :create do
unless repository_exists?(@current_resource.name)
Chef::Nexus.nexus(node).create_repository(new_resource.name, true, new_resource.url, nil, nil, nil)
Chef::Nexus.nexus(node).create_repository(new_resource.name, true, new_resource.url, nil, new_resource.policy, nil)
set_publisher if new_resource.publisher
set_subscriber if new_resource.subscriber
new_resource.updated_by_last_action(true)
Expand Down
1 change: 1 addition & 0 deletions resources/hosted_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@

attribute :name, :kind_of => String, :name_attribute => true
attribute :publisher, :kind_of => [TrueClass, FalseClass], :default => nil
attribute :policy, :kind_of => String, :default => nil
1 change: 1 addition & 0 deletions resources/proxy_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

attribute :name, :kind_of => String, :name_attribute => true
attribute :url, :kind_of => String, :required => true
attribute :policy, :kind_of => String, :default => nil
attribute :publisher, :kind_of => [TrueClass, FalseClass], :default => nil
attribute :subscriber, :kind_of => [TrueClass, FalseClass], :default => nil
attribute :preemptive_fetch, :kind_of => [TrueClass, FalseClass], :default => false

0 comments on commit f2ad702

Please sign in to comment.