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

Quote postgres privilege target names #36249

Merged
merged 3 commits into from
Sep 15, 2016
Merged

Quote postgres privilege target names #36249

merged 3 commits into from
Sep 15, 2016

Conversation

alertedsnake
Copy link
Contributor

@alertedsnake alertedsnake commented Sep 12, 2016

What does this PR do?

Quotes privilege update target names and role names in salt.states.postgres_privileges.
You can put certain characters in your table/database/role names which PostgreSQL
allows but then requires you to quote. So we should always quote these.

What issues does this PR fix or reference?

None

Previous Behavior

Privilege target and role names were not quoted, this results in exceptions when you have a table, database, or role name which contains odd characters, such as a dash.

New Behavior

Quotes things which need to be quoted.

Tests written?

Unit tests have been updated.

Postgres lets you put characters in table/database names which you then must
quote.  So we should always quote.
@cachedout
Copy link
Contributor

Hi @alertedsnake. This is breaking the unit tests for postgres. Would you mind having a look? Let me know if I can help.

@alertedsnake
Copy link
Contributor Author

alertedsnake commented Sep 13, 2016 via email

@cachedout
Copy link
Contributor

@alertedsnake Many thanks!

@alertedsnake
Copy link
Contributor Author

@cachedout That ought to fix the Postgres unit tests - I notice a bunch of other things fail, but nothing I touched.

Role names can also have dashes (or others) in them, so we must also quote
them.
@rallytime rallytime merged commit fbbe9ec into saltstack:2016.3 Sep 15, 2016
@alertedsnake alertedsnake deleted the bugfix/2016.3-fix-postgresql-grants branch September 15, 2016 21:13
gitebra pushed a commit to gitebra/salt that referenced this pull request Sep 19, 2016
* upstream/develop: (30 commits)
  correct key check
  Create a set from the minion list
  Skip extra traversals of minion cache for auth
  Whitespace fix
  Add -V option to work with --versions-report
  Update usage docs for Thorium (saltstack#36368)
  Fix calc docstrings (saltstack#36366)
  Fix a minor typo in docs (saltstack#36365)
  salt/modules/apk.py: Add version() function support (saltstack#36362)
  postgres_extension: report changes when an extension was installed (saltstack#36335)
  Schema test requires jsonschema 2.5.0 or above
  Check for Ign/Hit membership instead of == in aptpkg.refresh_db
  Quote postgres privilege target names (saltstack#36249)
  Fixed arguments to VPC peering function (saltstack#36268)
  set __virtualname__ to 'service' (saltstack#36330)
  Use infoblox_* values if present in arguments (saltstack#36339)
  Return None when find_file identifies the path as a directory (saltstack#36342)
  remove help message from glance module (saltstack#36345)
  Clean up libcloud stack trace (saltstack#36314)
  Add resize2fs unit test from blockdev_test to disk_test (saltstack#36346)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants