MCPcopy Create free account
hub / github.com/apache/impala / exec_cmd

Function exec_cmd

infra/python/bootstrap_virtualenv.py:112–124  ·  view source on GitHub ↗

Executes a command and waits for it to finish, raises an exception if the return status is not zero. The command output is returned. 'args' and 'kwargs' use the same format as subprocess.Popen().

(args, **kwargs)

Source from the content-addressed store, hash-verified

110
111
112def exec_cmd(args, **kwargs):
113 '''Executes a command and waits for it to finish, raises an exception if the return
114 status is not zero. The command output is returned.
115
116 'args' and 'kwargs' use the same format as subprocess.Popen().
117 '''
118 process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
119 universal_newlines=True, **kwargs)
120 output = process.communicate()[0]
121 if process.returncode != 0:
122 raise Exception("Command returned non-zero status\nCommand: %s\nOutput: %s"
123 % (args, output))
124 return output
125
126
127def select_cc():

Callers 2

create_virtualenvFunction · 0.70
exec_pip_installFunction · 0.70

Calls 1

communicateMethod · 0.80

Tested by

no test coverage detected