MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / RunWithRetuncode

Function RunWithRetuncode

tools/fedb_migrate.py:103–117  ·  view source on GitHub ↗
(command,
                     universal_newlines = True,
                     useshell = USE_SHELL,
                     env = os.environ)

Source from the content-addressed store, hash-verified

101 return -1
102
103def RunWithRetuncode(command,
104 universal_newlines = True,
105 useshell = USE_SHELL,
106 env = os.environ):
107 try:
108 p = subprocess.Popen(command, stdout = subprocess.PIPE, stderr = subprocess.PIPE, shell = useshell, universal_newlines = universal_newlines, env = env )
109 output = p.stdout.read()
110 p.wait()
111 errout = p.stderr.read()
112 p.stdout.close()
113 p.stderr.close()
114 return p.returncode,output,errout
115 except Exception,ex:
116 print(ex)
117 return -1,None,None
118
119def GetTables(output):
120 # name tid pid endpoint role ttl is_alive compress_type

Callers 6

AnalysisFunction · 0.85
GetLeaderFollowerOffsetFunction · 0.85
ChangeLeaderFunction · 0.85
RecoverEndpointFunction · 0.85
RecoverDataFunction · 0.85
BalanceLeaderFunction · 0.85

Calls 1

closeMethod · 0.65

Tested by

no test coverage detected