Bug 1286722 - hammer returns return code 0(zero) for failed repo sync
hammer returns return code 0(zero) for failed repo sync
Status: CLOSED NEXTRELEASE
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Tasks Plugin (Show other bugs)
6.1.5
Unspecified Unspecified
unspecified Severity medium (vote)
: Unspecified
: --
Assigned To: Eric Helms
Kedar Bidarkar
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-30 10:15 EST by Jitendra Yejare
Modified: 2017-08-01 16:02 EDT (History)
5 users (show)

See Also:
Fixed In Version: rubygem-hammer_cli_foreman_tasks-0.0.10.3-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-01 16:02:43 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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 10647 None None None 2016-05-26 17:48 EDT

  None (edit)
Description Jitendra Yejare 2015-11-30 10:15:26 EST
Description of problem:
Hammer returns return code 0 for failed repository sync.
e.g:
# hammer -u admin -p changeme repository synchronize --name test_pro_repo --product test_pro --organization 'Default Organization'
[....................................................................................................................................................................................................................................] [100%]
Yum Metadata: Not Found
PLP0000: Importer indicated a failed response

#echo $?
0

Version-Release number of selected component (if applicable):
rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el6_6sat.noarch
rubygem-hammer_cli_katello-0.0.7.18-1.el6.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.5-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_docker-0.0.3.10-1.el6.noarch
rubygem-hammer_cli-0.1.4.13-1.el6.noarch
rubygem-hammer_cli_foreman-0.1.4.14-1.el6_6sat.noarch
rubygem-hammer_cli_gutterball-0.0.1.3-1.el6_6sat.noarch
rubygem-hammer_cli_import-0.10.20-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el6_6sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create a custom product.
2. Add repository of type yum with URL which is down/not accessible/with no yum metadata in above product.
3. Sync the repository from hammer.
4. See the return code of last executed hammer command.

Actual results:
The return code is 0.

Expected results:
The return code should be 1 as the repository sync is failed.

Additional info:
Comment 2 Bryan Kearney 2015-12-01 13:06:30 EST
Created redmine issue http://projects.theforeman.org/issues/12647 from this bug
Comment 6 Zach Huntington-Meath 2016-04-19 11:23:19 EDT
This issue has been solved, and the change has been applied. https://github.com/theforeman/hammer-cli-foreman-tasks/pull/20
Comment 7 Kedar Bidarkar 2016-05-25 10:41:21 EDT
This change https://github.com/theforeman/hammer-cli-foreman-tasks/pull/20 doesn't seem to exist in build sat62-snap12.1/tfm-rubygem-foreman-tasks-0.7.14.4-1.el7sat.noarch

~]# grep SOFTWARE /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_tasks-0.0.10.1/lib/hammer_cli_foreman_tasks/async_command.rb



TESTED with sat62-snap(GA)-12.1
Comment 8 Kedar Bidarkar 2016-06-13 06:16:52 EDT
[root@xyz ~]# hammer -u admin -p changeme repository synchronize --name rhel7_repo_tools --product rhel7_prd_tools --organization 'Default Organization'
[......................................................................] [100%]
Error: RPM1004: Error retrieving metadata: Not found
[root@xyz ~]# echo $?
0
[root@xyz ~]# rpm -qav | grep -i cli_foreman
tfm-rubygem-hammer_cli_foreman_remote_execution-0.0.5.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_tasks-0.0.10.3-1.el7sat.noarch


TESTED with sat62-snap(GA)-15.2

We still see the same issue, we still get a return code '0' for failed sync.
Comment 9 Bryan Kearney 2016-06-13 14:10:12 EDT
Upstream bug assigned to ehelms@redhat.com
Comment 10 Bryan Kearney 2016-06-13 14:10:14 EDT
Upstream bug component is Tasks Plugin
Comment 12 Bryan Kearney 2016-06-13 16:09:49 EDT
Moving to POST since upstream bug http://projects.theforeman.org/issues/10647 has been closed
Comment 13 Bryan Kearney 2016-06-16 10:09:47 EDT
Moving to POST since upstream bug http://projects.theforeman.org/issues/10647 has been closed
Comment 16 Eric Helms 2016-07-07 17:47:52 EDT
I have submitted an additional fix for this upstream:

https://github.com/theforeman/hammer-cli-foreman-tasks/pull/30
Comment 17 Bryan Kearney 2017-08-01 16:02:43 EDT
The fix to this bug will be delivered with release 6.3 of Satellite.

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