mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
postgres: remove all references to "CREATEUSER" role flag
The CREATEUSER flag has been an alias of the SUPERUSER flag, but was already declared obsolete in PostgreSQL 8.1 (see the documentation https://www.postgresql.org/docs/8.1/static/sql-createrole.html for reference). PostgreSQL 8.1 has been EoLed in November 2010 ( https://www.postgresql.org/support/versioning/ ), which is a long time ago. In PostgreSQL 9.6 (released September 2016), support for the CREATEUSER keyword has finally been removed: https://www.postgresql.org/docs/current/static/release-9-6.html The state modules state.postgres_group and state.postgres_user use the "createuser" flag as an alias to the "createroles" flag (and their documentation notes that this use differs from the PostgreSQL usage of the flag of the same name). To add to the confusion, the execution module modules.postgresql uses the "createuser" flag to set the "superuser" flag if "superuser" is set to None. This patch removes all mentions of "createuser" from the state and execution module and from associated tests (docstrings have been fixed, too). This should reduce confusion by a fair amount and brings the Saltstack interface to PostgreSQL's own terms.
This commit is contained in:
parent
9ee2786b62
commit
1529ed2621
@ -995,7 +995,6 @@ def _role_cmd_args(name,
|
||||
connlimit=None,
|
||||
inherit=None,
|
||||
createdb=None,
|
||||
createuser=None,
|
||||
createroles=None,
|
||||
superuser=None,
|
||||
groups=None,
|
||||
@ -1003,8 +1002,6 @@ def _role_cmd_args(name,
|
||||
rolepassword=None,
|
||||
valid_until=None,
|
||||
db_role=None):
|
||||
if createuser is not None and superuser is None:
|
||||
superuser = createuser
|
||||
if inherit is None:
|
||||
if typ_ in ['user', 'group']:
|
||||
inherit = True
|
||||
@ -1088,7 +1085,6 @@ def _role_create(name,
|
||||
password=None,
|
||||
createdb=None,
|
||||
createroles=None,
|
||||
createuser=None,
|
||||
encrypted=None,
|
||||
superuser=None,
|
||||
login=None,
|
||||
@ -1121,7 +1117,6 @@ def _role_create(name,
|
||||
inherit=inherit,
|
||||
createdb=createdb,
|
||||
createroles=createroles,
|
||||
createuser=createuser,
|
||||
superuser=superuser,
|
||||
groups=groups,
|
||||
replication=replication,
|
||||
@ -1143,7 +1138,6 @@ def user_create(username,
|
||||
maintenance_db=None,
|
||||
password=None,
|
||||
createdb=None,
|
||||
createuser=None,
|
||||
createroles=None,
|
||||
inherit=None,
|
||||
login=None,
|
||||
@ -1174,7 +1168,6 @@ def user_create(username,
|
||||
maintenance_db=maintenance_db,
|
||||
password=password,
|
||||
createdb=createdb,
|
||||
createuser=createuser,
|
||||
createroles=createroles,
|
||||
inherit=inherit,
|
||||
login=login,
|
||||
@ -1195,7 +1188,6 @@ def _role_update(name,
|
||||
maintenance_db=None,
|
||||
password=None,
|
||||
createdb=None,
|
||||
createuser=None,
|
||||
typ_='role',
|
||||
createroles=None,
|
||||
inherit=None,
|
||||
@ -1235,7 +1227,6 @@ def _role_update(name,
|
||||
connlimit=connlimit,
|
||||
inherit=inherit,
|
||||
createdb=createdb,
|
||||
createuser=createuser,
|
||||
createroles=createroles,
|
||||
superuser=superuser,
|
||||
groups=groups,
|
||||
@ -1259,7 +1250,6 @@ def user_update(username,
|
||||
maintenance_db=None,
|
||||
password=None,
|
||||
createdb=None,
|
||||
createuser=None,
|
||||
createroles=None,
|
||||
encrypted=None,
|
||||
superuser=None,
|
||||
@ -1293,7 +1283,6 @@ def user_update(username,
|
||||
login=login,
|
||||
connlimit=connlimit,
|
||||
createdb=createdb,
|
||||
createuser=createuser,
|
||||
createroles=createroles,
|
||||
encrypted=encrypted,
|
||||
superuser=superuser,
|
||||
@ -1740,7 +1729,6 @@ def group_create(groupname,
|
||||
maintenance_db=None,
|
||||
password=None,
|
||||
createdb=None,
|
||||
createuser=None,
|
||||
createroles=None,
|
||||
encrypted=None,
|
||||
login=None,
|
||||
@ -1771,7 +1759,6 @@ def group_create(groupname,
|
||||
password=password,
|
||||
createdb=createdb,
|
||||
createroles=createroles,
|
||||
createuser=createuser,
|
||||
encrypted=encrypted,
|
||||
login=login,
|
||||
inherit=inherit,
|
||||
@ -1790,7 +1777,6 @@ def group_update(groupname,
|
||||
password=None,
|
||||
createdb=None,
|
||||
createroles=None,
|
||||
createuser=None,
|
||||
encrypted=None,
|
||||
inherit=None,
|
||||
login=None,
|
||||
@ -1819,7 +1805,6 @@ def group_update(groupname,
|
||||
createdb=createdb,
|
||||
typ_='group',
|
||||
createroles=createroles,
|
||||
createuser=createuser,
|
||||
encrypted=encrypted,
|
||||
login=login,
|
||||
inherit=inherit,
|
||||
|
@ -36,7 +36,6 @@ def __virtual__():
|
||||
def present(name,
|
||||
createdb=None,
|
||||
createroles=None,
|
||||
createuser=None,
|
||||
encrypted=None,
|
||||
superuser=None,
|
||||
inherit=None,
|
||||
@ -66,10 +65,6 @@ def present(name,
|
||||
createroles
|
||||
Is the group allowed to create other roles/users
|
||||
|
||||
createuser
|
||||
Alias to create roles, and history problem, in pgsql normally
|
||||
createuser == superuser
|
||||
|
||||
encrypted
|
||||
Should the password be encrypted in the system catalog?
|
||||
|
||||
@ -131,8 +126,6 @@ def present(name,
|
||||
'result': True,
|
||||
'comment': 'Group {0} is already present'.format(name)}
|
||||
|
||||
if createuser:
|
||||
createroles = True
|
||||
# default to encrypted passwords
|
||||
if encrypted is not False:
|
||||
encrypted = postgres._DEFAULT_PASSWORDS_ENCRYPTION
|
||||
|
@ -37,7 +37,6 @@ def __virtual__():
|
||||
def present(name,
|
||||
createdb=None,
|
||||
createroles=None,
|
||||
createuser=None,
|
||||
encrypted=None,
|
||||
superuser=None,
|
||||
replication=None,
|
||||
@ -69,9 +68,6 @@ def present(name,
|
||||
createroles
|
||||
Is the user allowed to create other users?
|
||||
|
||||
createuser
|
||||
Alias to create roles
|
||||
|
||||
encrypted
|
||||
Should the password be encrypted in the system catalog?
|
||||
|
||||
@ -142,8 +138,6 @@ def present(name,
|
||||
'result': True,
|
||||
'comment': 'User {0} is already present'.format(name)}
|
||||
|
||||
if createuser:
|
||||
createroles = True
|
||||
# default to encrypted passwords
|
||||
if encrypted is not False:
|
||||
encrypted = postgres._DEFAULT_PASSWORDS_ENCRYPTION
|
||||
|
@ -249,7 +249,6 @@ class PostgresTestCase(TestCase, LoaderModuleMockMixin):
|
||||
maintenance_db='maint_db',
|
||||
password='foo',
|
||||
createdb=False,
|
||||
createuser=False,
|
||||
encrypted=False,
|
||||
superuser=False,
|
||||
replication=False,
|
||||
@ -299,7 +298,6 @@ class PostgresTestCase(TestCase, LoaderModuleMockMixin):
|
||||
maintenance_db='maint_db',
|
||||
password='foo',
|
||||
createdb=False,
|
||||
createuser=False,
|
||||
encrypted=False,
|
||||
replication=False,
|
||||
rolepassword='test_role_pass',
|
||||
@ -331,7 +329,6 @@ class PostgresTestCase(TestCase, LoaderModuleMockMixin):
|
||||
login=True,
|
||||
createdb=False,
|
||||
createroles=False,
|
||||
createuser=False,
|
||||
encrypted=False,
|
||||
superuser=False,
|
||||
replication=False,
|
||||
@ -466,7 +463,6 @@ class PostgresTestCase(TestCase, LoaderModuleMockMixin):
|
||||
password='test_pass',
|
||||
createdb=False,
|
||||
createroles=False,
|
||||
createuser=False,
|
||||
encrypted=False,
|
||||
inherit=True,
|
||||
login=True,
|
||||
@ -505,7 +501,6 @@ class PostgresTestCase(TestCase, LoaderModuleMockMixin):
|
||||
password='test_pass',
|
||||
createdb=False,
|
||||
createroles=True,
|
||||
createuser=False,
|
||||
encrypted=False,
|
||||
inherit=True,
|
||||
login=True,
|
||||
@ -540,7 +535,6 @@ class PostgresTestCase(TestCase, LoaderModuleMockMixin):
|
||||
password='test_pass',
|
||||
createdb=False,
|
||||
createroles=True,
|
||||
createuser=False,
|
||||
encrypted=False,
|
||||
inherit=True,
|
||||
login=True,
|
||||
@ -576,7 +570,6 @@ class PostgresTestCase(TestCase, LoaderModuleMockMixin):
|
||||
password='test_pass',
|
||||
createdb=False,
|
||||
createroles=True,
|
||||
createuser=False,
|
||||
encrypted=True,
|
||||
inherit=True,
|
||||
login=True,
|
||||
|
Loading…
Reference in New Issue
Block a user