Added capability to deploy PostgreSQL servers on Amazon RDS. Fixes #7177

This commit is contained in:
Khushboo Vashi
2022-02-14 12:13:48 +05:30
committed by Akshay Joshi
parent b89e306df0
commit e61a1045f5
50 changed files with 3393 additions and 42 deletions

38
web/pgacloud/utils/io.py Normal file
View File

@@ -0,0 +1,38 @@
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2022, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
import datetime
import json
import sys
import time
def debug(args, message):
""" Print a debug message """
if not args.debug:
return
now = datetime.datetime.now()
print('[{}]: {}'.format(now.strftime("%H:%M:%S"), message),
file=sys.stderr, flush=True)
def error(args, message):
""" Print an error message and exit """
debug(args, message)
output({'error': message})
sys.exit(1)
def output(data):
""" Dump JSON output from a dict """
print(json.dumps(data), flush=True)