Display server and config info at connect time for crash_gen tool

This commit is contained in:
Steven Li 2020-07-15 07:09:15 +00:00
parent 412abce6ea
commit 44bbeea8a2
1 changed files with 7 additions and 1 deletions

View File

@ -763,10 +763,16 @@ class DbConnNative(DbConn):
break
return buildPath
connInfoDisplayed = False
def openByType(self): # Open connection
cfgPath = self.getBuildPath() + "/test/cfg"
hostAddr = "127.0.0.1"
if not self.connInfoDisplayed:
logger.info("Initiating TAOS native connection to {}, using config at {}".format(hostAddr, cfgPath))
self.connInfoDisplayed = True
self._conn = taos.connect(
host="127.0.0.1",
host=hostAddr,
config=cfgPath) # TODO: make configurable
self._cursor = self._conn.cursor()