From 0e0b04617f4c7a979e9302b0207fb43bb3263f2d Mon Sep 17 00:00:00 2001 From: Bruno Clermont Date: Sun, 11 Nov 2012 22:50:49 +0800 Subject: [PATCH] fix ENCRYPTED usage on user creation --- salt/modules/postgres.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/modules/postgres.py b/salt/modules/postgres.py index 19aed42ab9..840a1eb50a 100644 --- a/salt/modules/postgres.py +++ b/salt/modules/postgres.py @@ -320,14 +320,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, )