Data-Test-Executer Framework speziell zum Test von Datenverarbeitungen mit Datengenerierung, Systemvorbereitungen, Einspielungen, ganzheitlicher diversifizierender Vergleich
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.6 KiB

3 years ago
# functions about connections to other instances
# -------------------------------------------------------------------
"""
"""
import ulrich.program
import utils.config_tool
def getConnection(comp, nr):
job = ulrich.program.Job.getInstance()
verify = job.getDebugLevel("conn_tool")
conn = {}
if job.conf.confs.get("tools").get("connsrc") == "yml":
conn = utils.config_tool.getConfig("tool", "conn")
instnr = "inst" + str(nr)
if conn["env"][comp][instnr]:
return conn["env"][comp][instnr]
else:
job.m.setFatal("Conn-Tool: Comp not configured " + comp + " " + str(nr))
elif job.conf.confs.get("tools").get("connsrc") == "db":
pass
elif job.conf.confs.get("tools").get("connsrc") == "csv":
pass
return None
def getConnections(comp):
job = ulrich.program.Job.getInstance()
verify = job.getDebugLevel("conn_tool")
print("getConnections " + comp)
conn = {}
conns = []
if job.conf.confs.get("tools").get("connsrc") == "yml":
conn = utils.config_tool.getConfig("tool", "conn")
if not comp in conn["env"]:
job.m.setFatal("Conn-Tool: Comp not configured " + comp)
elif job.conf.confs.get("tools").get("connsrc") == "db":
pass
elif job.conf.confs.get("tools").get("connsrc") == "csv":
pass
print(comp)
print(conn["env"].keys())
print(conn["env"][comp]["instance"])
for i in range(conn["env"][comp]["instance"]):
print("range " + str(i+1))
instnr = "inst" + str(i+1)
conns.append(conn["env"][comp][instnr])
return conns