File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ def run(self):
70
70
"""
71
71
Run the sequence of commands and capture their output and return code.
72
72
First command that returns code other than 0 terminates the sequence.
73
+ If the command has return code 2, the sequence will be terminated
74
+ however it will not be treated as error.
73
75
"""
74
76
75
77
for command in self .commands :
@@ -81,9 +83,15 @@ def run(self):
81
83
self .outputs [str (cmd )] = cmd .getoutput ()
82
84
83
85
# If a command fails, terminate the sequence of commands.
84
- if cmd .getretcode () != 0 :
85
- self .logger .debug ("command {} failed, breaking" .format (cmd ))
86
- self .failed = True
86
+ retcode = cmd .getretcode ()
87
+ if retcode != 0 :
88
+ if retcode == 2 :
89
+ self .logger .info ("command '{}' requested break" .
90
+ format (cmd ))
91
+ else :
92
+ self .logger .info ("command '{}' failed with code {}, "
93
+ "breaking" .format (cmd , retcode ))
94
+ self .failed = True
87
95
break
88
96
89
97
def check (self , ignore_errors ):
Original file line number Diff line number Diff line change 195
195
if project_config .get ('disabled' ):
196
196
logger .info ("Project {} disabled, exiting" .
197
197
format (args .project ))
198
- sys .exit (0 )
198
+ sys .exit (2 )
199
199
200
200
lock = filelock .FileLock (os .path .join (tempfile .gettempdir (),
201
201
args .project + "-mirror.lock" ))
You can’t perform that action at this time.
0 commit comments