def tenant_report(tenant_config):
from drift.tenant import get_connection_string
conn_string = get_connection_string(tenant_config)
print "Tenant configuration for '{}' on tier '{}':" \
.format(tenant_config["name"], get_tier_name())
for k in sorted(tenant_config.keys()):
print " {} = {}".format(k, tenant_config[k])
print "Connection string:\n {}".format(conn_string)
print "Database check... "
db_error = db_check(tenant_config)
if db_error:
if "does not exist" in db_error:
print Fore.RED + " FAIL! DB does not exist"
print " You can create this database by running this " \
"command again with the action 'create'"
else:
print Fore.RED + " {}".format(db_error)
else:
print Fore.GREEN + " OK! Database is online and reachable"
评论列表
文章目录