Skip to content

Commit

Permalink
Merge pull request voxpupuli#96 from apenney/providers
Browse files Browse the repository at this point in the history
Replace confines with autorequire.
  • Loading branch information
Ashley Penney committed Jul 29, 2013
2 parents 1c367eb + e6f2dd0 commit 77736a7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
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 @@ -131,7 +131,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<| |>

}

0 comments on commit 77736a7

Please sign in to comment.