Skip to content

Commit

Permalink
fix(jans-linux-setup): postgresql permission (#6890)
Browse files Browse the repository at this point in the history
Signed-off-by: Mustafa Baser <mbaser@mail.com>
  • Loading branch information
devrimyatar committed Dec 30, 2023
1 parent 9d0e82c commit 2ad2bca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jans-linux-setup/jans_setup/setup_app/installers/rdbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ def local_install(self):
cmd_create_db = '''su - postgres -c "psql -U postgres -d postgres -c \\"CREATE DATABASE {};\\""'''.format(Config.rdbm_db)
cmd_create_user = '''su - postgres -c "psql -U postgres -d postgres -c \\"CREATE USER {} WITH PASSWORD '{}';\\""'''.format(Config.rdbm_user, Config.rdbm_password)
cmd_grant_previlages = '''su - postgres -c "psql -U postgres -d postgres -c \\"GRANT ALL PRIVILEGES ON DATABASE {} TO {};\\""'''.format(Config.rdbm_db, Config.rdbm_user)
cmd_alter_db = f'''su - postgres -c "psql -U postgres -d postgres -c \\"ALTER DATABASE {Config.rdbm_db} OWNER TO {Config.rdbm_user};\\""'''

for cmd in (cmd_create_db, cmd_create_user, cmd_grant_previlages):
for cmd in (cmd_create_db, cmd_create_user, cmd_grant_previlages, cmd_alter_db):
self.run(cmd, shell=True)

if base.clone_type == 'rpm':
Expand Down

0 comments on commit 2ad2bca

Please sign in to comment.