Skip to content

Commit

Permalink
Merge pull request ansible#2543 from b6d/postgresql_user-docfix
Browse files Browse the repository at this point in the history
postgresql_user: fix docstrings
  • Loading branch information
mpdehaan committed Apr 1, 2013
2 parents 1ad61b3 + 8456cb8 commit f5b9e4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/postgresql_user
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ options:
"[NO]INHERIT", "[NO]LOGIN", "[NO]REPLICATION" ]
state:
description:
- The database state
- The user (role) state
required: false
default: present
choices: [ "present", "absent" ]
Expand Down Expand Up @@ -141,13 +141,13 @@ def user_exists(cursor, user):


def user_add(cursor, user, password, role_attr_flags):
"""Create a new user with write access to the database"""
"""Create a new database user (role)."""
query = "CREATE USER \"%(user)s\" with PASSWORD '%(password)s' %(role_attr_flags)s"
cursor.execute(query % {"user": user, "password": password, "role_attr_flags": role_attr_flags})
return True

def user_alter(cursor, user, password, role_attr_flags):
"""Change user password"""
"""Change user password and/or attributes. Return True if changed, False otherwise."""
changed = False

if user == 'PUBLIC':
Expand Down

0 comments on commit f5b9e4d

Please sign in to comment.