Project

General

Profile

Bug #13442

foreman-debug script should return a meaningful exit code

Added by Elyézer Rezende over 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Category:
foreman-debug
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

foreman-debug script returns non-zero return code even if it completes successfully, which makes hard to automate/script since the return code is not reliable.

[root@foreman-rhel7 ~]# foreman-debug -d ~/1-foreman-debugExporting tasks, this may take a few minutes.

 HOSTNAME: foreman-rhel7.server.com
       OS: redhat
  RELEASE: Red Hat Enterprise Linux Server release 7.2 (Maipo)
  FOREMAN: 1.7.2
SATELLITE: 6.1.6
     RUBY: ruby 2.0.0p598 (2014-11-13) [x86_64-linux]
   PUPPET: 3.6.2
  DENIALS: 0

A debug file has been created: /root/1-foreman-debug.tar.xz (773856 bytes)

[root@qe-sat6-cdn-rhel7 ~]# echo $?
1

Associated revisions

Revision 8c3bed8c (diff)
Added by Lukas Zapletal over 3 years ago

Fixes #13442 - foreman-debug exits with 0 on success

Revision 97db43ee (diff)
Added by Lukas Zapletal over 3 years ago

Fixes #13442 - foreman-debug exits with 0 on success

(cherry picked from commit 8c3bed8c69518ee46015705277b359270b2f9c29)

History

#1 Updated by Dominic Cleal over 3 years ago

  • Status changed from New to Rejected

Cannot reproduce on a current release, please update.

# foreman-debug -d ~/1-foreman-debug; echo $?

 HOSTNAME: foreman.example.com
       OS: redhat
  RELEASE: CentOS Linux release 7.0.1406 (Core) 
  FOREMAN: 1.11.0-develop
     RUBY: ruby 2.0.0p598 (2014-11-13) [x86_64-linux]
   PUPPET: 3.8.5
  DENIALS: 1

A debug file has been created: /root/1-foreman-debug.tar.xz (237348 bytes)

To upload a tarball to our secure site, please use the -u option.
0

#2 Updated by Elyézer Rezende over 3 years ago

I can't update the version on the issue, but I have foreman-debug-1.7.2.50-1.el7sat.noarch installed here. Also the foreman-debug output points out FOREMAN: 1.7.2.

#3 Updated by Dominic Cleal over 3 years ago

Please file a bug with Red Hat or contact them for support, as Foreman upstream appears to be working fine.

#4 Updated by Lukas Zapletal over 3 years ago

  • Category set to Packaging
  • Status changed from Rejected to Assigned
  • Assignee set to Lukas Zapletal

Reproducer:

echo "UPLOAD_DISABLED=1" > /usr/share/foreman/config/foreman-debug.conf
foreman-debug
echo $?
1

Easy help, thanks for report. Have you already created a BZ? Can you send me a link please?

#5 Updated by The Foreman Bot over 3 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3147 added

#6 Updated by Lukas Zapletal over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#7 Updated by Dominic Cleal over 3 years ago

  • Legacy Backlogs Release (now unused) set to 123

#8 Updated by Dominic Cleal over 3 years ago

  • Category changed from Packaging to foreman-debug

Also available in: Atom PDF