Bug 1002743 - remote command worked with expected output, but event history returned error
Summary: remote command worked with expected output, but event history returned error
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: 550
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: 462714
TreeView+ depends on / blocked
 
Reported: 2013-08-29 20:59 UTC by DzungDo
Modified: 2013-09-03 11:13 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-03 11:13:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description DzungDo 2013-08-29 20:59:14 UTC
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 11:13:26 UTC
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.