Skip to content

Commit e24bbdd

Browse files
committed
feat: change db parameters parsing to be similar to psql
1 parent e254d30 commit e24bbdd

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

mamonsu/tools/bootstrap/start.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def __init__(self):
8484
os.environ['PGPASSWORD'] = self.args.password
8585
os.environ['PGHOST'] = self.args.hostname
8686
os.environ['PGPORT'] = str(self.args.port)
87-
os.environ['PGDATABASE'] = self.args.dbname
87+
os.environ['PGDATABASE'] = self.args.username if self.args.dbname is None else self.args.dbname
8888
os.environ['PGAPPNAME'] = 'mamonsu deploy'
8989

9090
def try_configure_connect_to_pg(self):

mamonsu/tools/report/start.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __init__(self):
7070
group.add_option(
7171
'-d', '--dbname',
7272
dest='dbname',
73-
default=self.default_db(),
73+
default=None,
7474
help='database name to connect to (default: %default)')
7575
group.add_option(
7676
'--host',
@@ -102,7 +102,7 @@ def __init__(self):
102102
os.environ['PGUSER'] = self.args.username
103103
os.environ['PGPASSWORD'] = self.args.password
104104
os.environ['PGHOST'] = self.args.hostname
105-
os.environ['PGDATABASE'] = self.args.dbname
105+
os.environ['PGDATABASE'] = self.args.username if self.args.dbname is None else self.args.dbname
106106
os.environ['PGAPPNAME'] = 'mamonsu first look'
107107

108108
def try_configure_connect_to_pg(self):

mamonsu/tools/tune/start.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(self):
5555
group.add_option(
5656
'-d', '--dbname',
5757
dest='dbname',
58-
default=self.default_db(),
58+
default=None,
5959
help='database name to connect to (default: %default)')
6060
group.add_option(
6161
'--host',
@@ -87,7 +87,7 @@ def __init__(self):
8787
os.environ['PGUSER'] = self.args.username
8888
os.environ['PGPASSWORD'] = self.args.password
8989
os.environ['PGHOST'] = self.args.hostname
90-
os.environ['PGDATABASE'] = self.args.dbname
90+
os.environ['PGDATABASE'] = self.args.username if self.args.dbname is None else self.args.dbname
9191
os.environ['PGPORT'] = str(self.args.port)
9292
os.environ['PGAPPNAME'] = 'mamonsu autotune'
9393

0 commit comments

Comments
 (0)