Merge pull request #2520 from bclermont/postgres_encrypted_password

fix ENCRYPTED usage on user creation
This commit is contained in:
Thomas S Hatch 2012-11-11 09:37:39 -08:00
commit 1a6dc1db5b

View File

@ -315,14 +315,14 @@ def user_create(username,
sub_cmd = 'CREATE USER "{0}" WITH'.format(username, )
if password:
if encrypted:
sub_cmd = "{0} ENCRYPTED".format(sub_cmd, )
escaped_password = password.replace("'", "''")
sub_cmd = "{0} PASSWORD '{1}'".format(sub_cmd, escaped_password)
if createdb:
sub_cmd = "{0} CREATEDB".format(sub_cmd, )
if createuser:
sub_cmd = "{0} CREATEUSER".format(sub_cmd, )
if encrypted:
sub_cmd = "{0} ENCRYPTED".format(sub_cmd, )
if superuser:
sub_cmd = "{0} SUPERUSER".format(sub_cmd, )