Skip to content

Commit 8682230

Browse files
author
Alexander Popov
committed
feat/fix: PGPRO-4094, change mamonsu bootstrap
1 parent 372dc08 commit 8682230

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

mamonsu/lib/default_config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
import os
44
import logging
5+
import getpass
56
import mamonsu.lib.platform as platform
67

78

89
class PgsqlConfig(object):
910

1011
@staticmethod
1112
def default_user():
12-
user = os.environ.get('PGUSER') or 'postgres'
13+
user = os.environ.get('PGUSER') or getpass.getuser() or 'postgres'
1314
return user
1415

1516
@staticmethod
@@ -39,7 +40,7 @@ def default_app():
3940

4041
@staticmethod
4142
def default_db():
42-
database = os.environ.get('PGDATABASE') or os.environ.get('PGUSER')
43+
database = os.environ.get('PGDATABASE') or os.environ.get('PGUSER') or getpass.getuser()
4344
database = database or 'postgres'
4445
return database
4546

mamonsu/tools/bootstrap/start.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def __init__(self):
5959
bootstrap_group.add_option(
6060
'-M', '--mamonsu-username',
6161
dest='mamonsu_username',
62+
default=self.default_user(),
6263
help='database non-privileged user for mamonsu')
6364
parser.add_option_group(group)
6465
parser.add_option_group(bootstrap_group)

0 commit comments

Comments
 (0)