Bug 1002743 - remote command worked with expected output, but event history returned error
remote command worked with expected output, but event history returned error
Status: CLOSED NOTABUG
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
550
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tomas Lestach
Red Hat Satellite QA List
:
Depends On:
Blocks: 462714
  Show dependency treegraph
 
Reported: 2013-08-29 16:59 EDT by DzungDo
Modified: 2013-09-03 07:13 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-03 07:13:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description DzungDo 2013-08-29 16:59:14 EDT
Description of problem:
remote command worked with expected output, but event history returned error
From satellite server, run a remote command to a rhel 6 client:
yum check-update

Version-Release number of selected component (if applicable):
satellite-5.5.0-20120911

How reproducible:
always

Steps to Reproduce:
1. System -> select a system -> remote command
2. Enter "yum check-update" in the script text entry box
3. schedule a remote command and check the event history

Actual results:
command return the expected output (list of packages need to update), but status is: Failed


Expected results:
Action's status should be: Completed

Additional info:
Comment 1 Tomas Lestach 2013-09-03 07:13:26 EDT
Well, the status of the return command depends on the return code of the remote command.

On my machine:
* if there're no updates:
# yum check-update > /dev/null; echo $?
0
* if there're updates available:
# yum check-update > /dev/null; echo $?
100

So, if your script returns a non-zero value, the remote command is considered as failed.

Recommended usage:
=======================================================
#!/bin/sh 

yum check-update 
RET=$? 
if [ $RET -eq 100 ]; then exit 0; else exit $RET; fi
=======================================================

Closing as NOTABUG.

Note You need to log in before you can comment on or make changes to this bug.