Skip to content

Commit

Permalink
Merge pull request redhat-openstack#295 from sodabrew/patch-1
Browse files Browse the repository at this point in the history
Idiomatic syntax for should_policy and should_vhost
  • Loading branch information
cmurphy committed Jan 15, 2015
2 parents 384892a + d37c9ab commit 52d3557
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/puppet/provider/rabbitmq_policy/rabbitmqctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,11 @@ def policies(name, vhost)
end

def should_policy
if @should_policy
@should_policy
else
@should_policy = resource[:name].rpartition('@').first
end
@should_policy ||= resource[:name].rpartition('@').first
end

def should_vhost
if @should_vhost
@should_vhost
else
@should_vhost = resource[:name].rpartition('@').last
end
@should_vhost ||= resource[:name].rpartition('@').last
end

def create
Expand Down

0 comments on commit 52d3557

Please sign in to comment.