@@ -84,7 +84,6 @@ def make_vcs_requirement_url(repo_url, rev, project_name, subdir=None):
84
84
def call_subprocess (
85
85
cmd , # type: Union[List[str], CommandArgs]
86
86
cwd = None , # type: Optional[str]
87
- on_returncode = 'raise' , # type: str
88
87
extra_environ = None , # type: Optional[Mapping[str, Any]]
89
88
extra_ok_returncodes = None , # type: Optional[Iterable[int]]
90
89
log_failed_cmd = True # type: Optional[bool]
@@ -150,32 +149,21 @@ def call_subprocess(
150
149
proc .returncode and proc .returncode not in extra_ok_returncodes
151
150
)
152
151
if proc_had_error :
153
- if on_returncode == 'raise' :
154
- if not showing_subprocess and log_failed_cmd :
155
- # Then the subprocess streams haven't been logged to the
156
- # console yet.
157
- msg = make_subprocess_output_error (
158
- cmd_args = cmd ,
159
- cwd = cwd ,
160
- lines = all_output ,
161
- exit_status = proc .returncode ,
162
- )
163
- subprocess_logger .error (msg )
164
- exc_msg = (
165
- 'Command errored out with exit status {}: {} '
166
- 'Check the logs for full command output.'
167
- ).format (proc .returncode , command_desc )
168
- raise SubProcessError (exc_msg )
169
- elif on_returncode == 'warn' :
170
- subprocess_logger .warning (
171
- 'Command "{}" had error code {} in {}' .format (
172
- command_desc , proc .returncode , cwd )
152
+ if not showing_subprocess and log_failed_cmd :
153
+ # Then the subprocess streams haven't been logged to the
154
+ # console yet.
155
+ msg = make_subprocess_output_error (
156
+ cmd_args = cmd ,
157
+ cwd = cwd ,
158
+ lines = all_output ,
159
+ exit_status = proc .returncode ,
173
160
)
174
- elif on_returncode == 'ignore' :
175
- pass
176
- else :
177
- raise ValueError ('Invalid value: on_returncode={!r}' .format (
178
- on_returncode ))
161
+ subprocess_logger .error (msg )
162
+ exc_msg = (
163
+ 'Command errored out with exit status {}: {} '
164
+ 'Check the logs for full command output.'
165
+ ).format (proc .returncode , command_desc )
166
+ raise SubProcessError (exc_msg )
179
167
return '' .join (all_output )
180
168
181
169
@@ -768,7 +756,6 @@ def run_command(
768
756
cls ,
769
757
cmd , # type: Union[List[str], CommandArgs]
770
758
cwd = None , # type: Optional[str]
771
- on_returncode = 'raise' , # type: str
772
759
extra_environ = None , # type: Optional[Mapping[str, Any]]
773
760
extra_ok_returncodes = None , # type: Optional[Iterable[int]]
774
761
log_failed_cmd = True # type: bool
@@ -782,7 +769,6 @@ def run_command(
782
769
cmd = make_command (cls .name , * cmd )
783
770
try :
784
771
return call_subprocess (cmd , cwd ,
785
- on_returncode = on_returncode ,
786
772
extra_environ = extra_environ ,
787
773
extra_ok_returncodes = extra_ok_returncodes ,
788
774
log_failed_cmd = log_failed_cmd )
0 commit comments