Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

Setting empty password causes exception... #93

Closed
wants to merge 1 commit into from
Closed

Setting empty password causes exception... #93

wants to merge 1 commit into from

Conversation

notapatch
Copy link
Contributor

Setting an empty password for a pg_user causes an exception.

Bug

For pg_user.rb, the role_sql variable in Line 17 gets << a nil when there is no password and it throws an exception as it cannot implicitly convert nil into a string. My fix is to else an empty string.

Usage case

My usage case for no password. I configure a development systems and I want to create pg_user with the same name as a login. This gives my login user pg permissions, mainly CREATEDB, which is very useful to a rails developer.

Reproducing Error

Reproduce this in test-kitchen by converging with the following yml added.

 attributes:
      postgresql:
        users:
          - username: richard
            superuser: false
            createdb: true
            login: true

phlipper added a commit that referenced this pull request May 10, 2014
Setting empty password causes exception... #93
@phlipper
Copy link
Owner

@RichardWigley thank you very much for the detailed PR and fix! I have rebased this on top of the latest master and merged it in as #95

@phlipper phlipper closed this May 10, 2014
@notapatch
Copy link
Contributor Author

And thank you for merging. :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants