Skip to content

Commit 8e768c5

Browse files
committed
adding more proper check of return code for post command
Signed-off-by: Vanessa Sochat <[email protected]>
1 parent 158f4f3 commit 8e768c5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scompose/project/instance.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,17 @@ def run_post(self):
206206
if not isinstance(command, list):
207207
command = shlex.split(command)
208208

209-
self.client._run_command(command, quiet=True)
209+
# Capture the return code
210+
response = self.client._run_command(command,
211+
quiet=True,
212+
return_result=True)
213+
# If debug on, show output
214+
bot.debug("".join(response['message']))
215+
216+
# Alert the user if there is an error
217+
if response['return_code'] != 0:
218+
bot.error("".join(response['message']))
219+
bot.exit("Return code %s, exiting." % response['return_code'])
210220

211221
# Image
212222

0 commit comments

Comments
 (0)