X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/aa8c90a19bea26953f104b9b78751780dab2a101..f30f230da23603e3c7598205219ce01e9820c470:/cookbooks/postgresql/providers/table.rb diff --git a/cookbooks/postgresql/providers/table.rb b/cookbooks/postgresql/providers/table.rb index f162347dd..b1dc67571 100644 --- a/cookbooks/postgresql/providers/table.rb +++ b/cookbooks/postgresql/providers/table.rb @@ -67,12 +67,10 @@ action :create do @pg.execute(:command => "GRANT #{privilege.to_s.upcase} ON #{@name} TO \"#{user}\"", :database => new_resource.database) end end - else - if current_privileges.include?(privilege) - converge_by("revoke #{privilege} for #{user} on #{new_resource}") do - Chef::Log.info("Revoking #{privilege} for #{user} on #{new_resource}") - @pg.execute(:command => "REVOKE #{privilege.to_s.upcase} ON #{@name} FROM \"#{user}\"", :database => new_resource.database) - end + elsif current_privileges.include?(privilege) + converge_by("revoke #{privilege} for #{user} on #{new_resource}") do + Chef::Log.info("Revoking #{privilege} for #{user} on #{new_resource}") + @pg.execute(:command => "REVOKE #{privilege.to_s.upcase} ON #{@name} FROM \"#{user}\"", :database => new_resource.database) end end end