File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -115,8 +115,11 @@ def run_cleanup(self):
115
115
def check (self , ignore_errors ):
116
116
"""
117
117
Check the output of the commands and perform logging.
118
+
119
+ Return 0 on success, 1 if error was detected.
118
120
"""
119
121
122
+ ret = 0
120
123
self .logger .debug ("Output from {}:" .format (self .name ))
121
124
for cmd in self .outputs .keys ():
122
125
if self .outputs [cmd ] and len (self .outputs [cmd ]) > 0 :
@@ -129,6 +132,7 @@ def check(self, ignore_errors):
129
132
return
130
133
131
134
if any (rv != 0 and rv != 2 for rv in self .retcodes .values ()):
135
+ ret = 1
132
136
self .logger .error ("processing of {} failed" .
133
137
format (self ))
134
138
indent = " "
@@ -148,6 +152,7 @@ def check(self, ignore_errors):
148
152
errored_cmds = {k : v for k , v in self .outputs .items ()
149
153
if "error" in str (v ).lower ()}
150
154
if len (errored_cmds ) > 0 :
155
+ ret = 1
151
156
self .logger .error ("Command output in selfect {}"
152
157
" contains errors:" .format (self .name ))
153
158
indent = " "
@@ -158,3 +163,5 @@ def check(self, ignore_errors):
158
163
if out :
159
164
self .logger .error (out )
160
165
self .logger .error ("" )
166
+
167
+ return ret
You can’t perform that action at this time.
0 commit comments