- pg_config = {
- "host": args.db_host,
- "port": args.db_port,
- "user": args.db_user,
- "password": args.db_password,
- "database": args.db_database,
- }
- del(args.db_host)
- del(args.db_port)
- del(args.db_user)
- del(args.db_password)
- del(args.db_database)
-
- redis_config = {
- "host": args.redis_host,
- "port": args.redis_port,
- "db": args.redis_database,
- }
- if redis_config["host"].startswith("/"):
- redis_config["unix_socket_path"] = redis_config.pop("host")
- del(redis_config["port"])
- del(args.redis_host)
- del(args.redis_port)
- del(args.redis_database)
+ if args.db_host is not None:
+ dbs.connect_psql(args)
+
+ if args.redis_host is not None:
+ dbs.connect_redis(args)