fix: fixed bootstrap 'dnmame' check
@@ -80,11 +80,7 @@ class Args(DefaultConfig):
try:
cfg = Config(self.args.config)
self.args.dbname = cfg.fetch('postgres', 'database')
- # apply dbname env
- os.environ['PGDATABASE'] = self.args.dbname
except Exception as e:
- # apply dbname env
- os.environ['PGDATABASE'] = self.args.username
sys.stderr.write("ERROR: Database for mamonsu is not specified\n")
sys.stderr.write("{0}\n".format(e))
parser.print_bootstrap_help()
@@ -95,6 +91,7 @@ class Args(DefaultConfig):
os.environ['PGPASSWORD'] = self.args.password
os.environ['PGHOST'] = self.args.hostname
os.environ['PGPORT'] = str(self.args.port)
+ os.environ['PGDATABASE'] = self.args.username if self.args.dbname is None else self.args.dbname
os.environ['PGAPPNAME'] = 'mamonsu deploy'
def try_configure_connect_to_pg(self):
