Open varun-uc opened 5 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
Thank you for updating this issue. It is no longer marked as stale.
Description of Issue/Question
The postgres_privileges module throws error when checking privileges: https://github.com/saltstack/salt/blob/develop/salt/modules/postgres.py#L2698
Set permission for user fails after revoking all the privileges from the user. Set permission works fine when run for the first time and if tried to set permission after revoking privileges, it fails to set permissions.
Setup
Ubuntu 18.04.1 LTS server running salt-minion 2018.3.3 (Oxygen)
sls file to create user:
set_table_permission_accounts_accounts_db:
After setting table permissions for the user tried to revoke permissions which worked fine and again tried to set table permission which when got the following error. Query that ran to revoke permission and drop user:
Revoke permission query: Comment: Running Postgres query:
Drop User Query:
Steps to Reproduce Issue
1) Create a database and create sample tables in it. 2) Run sls file to set table permissions for a user (works fine for the first time). Once done revoking all privileges from the user.
After Revoking Permissions:
3) Again run the sls file to set table permission for the user. (Tested on both PostgreSQL 10 and PostgreSQL 11 however got same error)
The below example output was obtained when executed the 3rd step
Versions Report
Salt master is running 2018.3.3 with Python 3 on Ubuntu 18.04.1 LTS salt-call --versions-report
salt-master --versions-report
salt-minion --versions-report