提交 85ddff09 编写于 作者: S Shuduo Sang

refactor pathfinding in util/dnodes.py

上级 5e86a28a
...@@ -190,32 +190,31 @@ class TDDnode: ...@@ -190,32 +190,31 @@ class TDDnode:
"dnode:%d is deployed and configured by %s" % "dnode:%d is deployed and configured by %s" %
(self.index, self.cfgPath)) (self.index, self.cfgPath))
def start(self): def getBuildPath(self):
selfPath = os.path.dirname(os.path.realpath(__file__)) selfPath = os.path.dirname(os.path.realpath(__file__))
binPath = ""
if ("community" in selfPath): if ("community" in selfPath):
projPath = selfPath + "/../../../../" projPath = selfPath[:selfPath.find("community")]
for root, dirs, files in os.walk(projPath):
if ("taosd" in files):
rootRealPath = os.path.dirname(os.path.realpath(root))
if ("packaging" not in rootRealPath):
binPath = os.path.join(root, "taosd")
break
else: else:
projPath = selfPath + "/../../../" projPath = selfPath[:selfPath.find("tests")]
for root, dirs, files in os.walk(projPath):
if ("taosd" in files): for root, dirs, files in os.walk(projPath):
rootRealPath = os.path.dirname(os.path.realpath(root)) if ("taosd" in files):
if ("packaging" not in rootRealPath): rootRealPath = os.path.dirname(os.path.realpath(root))
binPath = os.path.join(root, "taosd") if ("packaging" not in rootRealPath):
break buildPath = root[:root.find("build")]
break
if (binPath == ""): return buildPath
def start(self):
buildPath = self.getBuildPath()
if (buildPath == ""):
tdLog.exit("taosd not found!") tdLog.exit("taosd not found!")
else: else:
tdLog.info("taosd found in %s" % rootRealPath) tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath + "/build/bin/taosd"
if self.deployed == 0: if self.deployed == 0:
tdLog.exit("dnode:%d is not deployed" % (self.index)) tdLog.exit("dnode:%d is not deployed" % (self.index))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册