Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace confines with autorequire. #96

Merged
merged 1 commit into from
Jul 29, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
end

defaultfor :feature => :posix
confine :false =>
begin
rabbitmqctl('list_users', '-q').find {|line|
line =~ /unable to connect to node/
}
rescue Puppet::Error => error
true
end

def self.instances
rabbitmqctl('list_users').split(/\n/)[1..-2].collect do |line|
Expand Down
8 changes: 0 additions & 8 deletions lib/puppet/provider/rabbitmq_user_permissions/rabbitmqctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@
end

defaultfor :feature=> :posix
confine :false =>
begin
rabbitmqctl('list_users', '-q').find {|line|
line =~ /unable to connect to node/
}
rescue Puppet::Error => error
true
end

# cache users permissions
def self.users(name, vhost)
Expand Down
2 changes: 2 additions & 0 deletions lib/puppet/type/rabbitmq_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
end
end

autorequire(:service) { 'rabbitmq-server' }

newparam(:name, :namevar => true) do
desc 'Name of user'
newvalues(/^\S+$/)
Expand Down
4 changes: 3 additions & 1 deletion lib/puppet/type/rabbitmq_user_permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
end
end

autorequire(:service) { 'rabbitmq-server' }

newparam(:name, :namevar => true) do
'combination of user@vhost to grant privileges to'
desc 'combination of user@vhost to grant privileges to'
newvalues(/^\S+@\S+$/)
end

Expand Down
2 changes: 0 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,5 @@
# Make sure the various providers have their requirements in place.
Class['::rabbitmq::install'] -> Rabbitmq_plugin<| |>
Class['::rabbitmq::install::rabbitmqadmin'] -> Rabbitmq_exchange<| |>
Class['::rabbitmq::service'] -> Rabbitmq_user<| |>
Class['::rabbitmq::service'] -> Rabbitmq_user_permissions<| |>

}