Description of problem: When you give incorrect OrgID to spacewalk-export, it happily continues. Version-Release number of selected component (if applicable): spacewalk-utils-2.3.2-8.el6sat.noarch How reproducible: always Steps to Reproduce: 1. # spacewalk-export --org=11111111111111111111111111111 Actual results: # rpm -qf `type -p spacewalk-export` spacewalk-utils-2.3.2-8.el6sat.noarch # spacewalk-export --org=11111111111111111111111111111 INFO: Processing users... INFO: Processing system-groups... INFO: Processing config-files... INFO: Processing repositories... INFO: Processing channels... Traceback (most recent call last): File "/usr/bin/spacewalk-export-channels", line 299, in <module> export_packages(options) File "/usr/bin/spacewalk-export-channels", line 97, in export_packages for org in orgs: TypeError: 'NoneType' object is not iterable INFO: Processing activation-keys... INFO: Processing kickstart-scripts... INFO: Processing system-profiles... INFO: Export-file created at /root/spacewalk-export-dir/spacewalk_export.tar.gz # echo $? 0 Expected results: There is a traceback in the output, but that is all. Tool should fail and exit with non-0 return code.
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
SW commit 81a2d535c4271ee384875311758a611946ba7048
Fixed behavior is: * spacewalk-export-channels now works even if no-orgs-with-id are found * spacewalk-export now checks for error-returns and logs ERROR when it finds them
Verified with spacewalk-utils-2.3.2-15 1) Export works with a correct org id. 2) After specifying an incorrect org id, the resulting archive is empty and no traceback is shown. Returns 0. 3) Errors are propagated and printed correctly (tested artificially with sys.exit(1) ). Return code is still 0 on failure but that's OK according to devel - the whole tool should only return non-zero on critical errors. Result of 3): INFO: Processing users... INFO: Processing system-groups... INFO: Processing config-files... INFO: Processing repositories... INFO: Processing channels... ERROR: Error response from /usr/bin/spacewalk-export-channels : [1] INFO: Processing activation-keys... INFO: Processing kickstart-scripts... INFO: Processing system-profiles... INFO: Export-file created at /root/spacewalk-export-dir/spacewalk_export.tar.gz echo $? 0
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-0281.html