Esempio n. 1
0
 def getRunScript(self, os, dir):
     path = None
     script = None
     if self.runType == RUN_TYPE_MASTER_ALWAYS:
         if not isWindows(os):
             path = getMonitorDir(os) + "run_" + self.run_info_name.strip() + ".sh"
             script = replaceStr(
                 RUN_PROCESS_SCRIPT,
                 {"run_info_name": self.run_info_name, "workingDir": self.workingDir, "runParam": self.runParam},
             )
             script = replaceStr(script, {"xtDir": dir})
         else:
             path = getMonitorDir(os) + "run_win" + self.run_info_name.strip() + ".bat"
             script = replaceStr(
                 WIN_RUN_PROCESS_SCRIPT, {"run_info_name": self.run_info_name, "workingDir": self.workingDir}
             )
             script = replaceStr(script, {"xtDir": dir})
     elif self.runType == RUN_TYPE_ALL_ALWAYS:
         if not isWindows(os):
             path = "/service/%s/run" % self.run_info_name.strip()
             script = replaceStr(
                 DAEMON_RUN_SCRIPT,
                 {"run_info_name": self.run_info_name, "workingDir": self.workingDir, "runParam": self.runParam},
             )
             script = replaceStr(script, {"xtDir": dir})
         else:
             path = "/service/%s.bat/run" % self.run_info_name.strip()
             script = replaceStr(
                 WIN_RUN_PROCESS_SCRIPT, {"run_info_name": self.run_info_name, "workingDir": self.workingDir}
             )
             script = replaceStr(script, {"xtDir": dir})
     return path, script
Esempio n. 2
0
 def getRunScript(self, os, dir):
     path = None
     script = None
     if self.runType == RUN_TYPE_MASTER_ALWAYS:
         if not isWindows(os):
             path = getMonitorDir(
                 os) + "run_" + self.run_info_name.strip() + ".sh"
             script = replaceStr(
                 RUN_PROCESS_SCRIPT, {
                     "run_info_name": self.run_info_name,
                     "workingDir": self.workingDir,
                     "runParam": self.runParam
                 })
             script = replaceStr(script, {"xtDir": dir})
         else:
             path = getMonitorDir(
                 os) + "run_win" + self.run_info_name.strip() + ".bat"
             script = replaceStr(
                 WIN_RUN_PROCESS_SCRIPT, {
                     "run_info_name": self.run_info_name,
                     "workingDir": self.workingDir
                 })
             script = replaceStr(script, {"xtDir": dir})
     elif self.runType == RUN_TYPE_ALL_ALWAYS:
         if not isWindows(os):
             path = "/service/%s/run" % self.run_info_name.strip()
             script = replaceStr(
                 DAEMON_RUN_SCRIPT, {
                     "run_info_name": self.run_info_name,
                     "workingDir": self.workingDir,
                     "runParam": self.runParam
                 })
             script = replaceStr(script, {"xtDir": dir})
         else:
             path = "/service/%s.bat/run" % self.run_info_name.strip()
             script = replaceStr(
                 WIN_RUN_PROCESS_SCRIPT, {
                     "run_info_name": self.run_info_name,
                     "workingDir": self.workingDir
                 })
             script = replaceStr(script, {"xtDir": dir})
     return path, script
Esempio n. 3
0
def getRealPathFromTar(rawPath, os):
    if isWindows(os):
        if len(rawPath) > 2:
            if rawPath[1] == "/":
                return rawPath[0] + ":" + rawPath[1:]
            else:
                return rawPath
        else:
            return rawPath
    else:
        if rawPath.startswith("/"):
            return rawPath
        else:
            return "/" + rawPath
Esempio n. 4
0
def getRealPathFromTar(rawPath, os):
    if isWindows(os):
        if len(rawPath) > 2:
            if rawPath[1] == "/" :
                return rawPath[0] + ":" + rawPath[1:]
            else:
                return rawPath
        else:
            return rawPath
    else:
        if rawPath.startswith("/"):
            return rawPath
        else:
            return "/" + rawPath
Esempio n. 5
0
def getLicensePath(os, xtDir):
    if isWindows(os):
        return "bin/license.data"
    else:
        return "server/bin/license.data"
Esempio n. 6
0
def getLicensePath(os, xtDir):
    if isWindows(os):
        return "bin/license.data"
    else:
        return "server/bin/license.data"