candlepin/subscription-manager — pull request #608 by alikins (2013-05-21 16:21:00+00:00)
Title: Fix echo'ing of exit status or exception on exit

cli.py main() had a "try/except Exception, e" added
to it. This exception handlers was not needed except
that code was raising Exceptions() as control flow,
instead of a more specific exception for the case
of trying to write to an already existing file. So
manifest_commands.py was changed to handle
EnvironmentError (base class of IOError/OSError)
itself, and the try/except Exception was removed.

That handler would call system_exit(exit_status,
exception) but system_exit expects (exit_status, msg),
and eventually call sys.exit(). On RHEL5, this was
causing the exit status to get echoed to stderr.

Error handling for dump-manifest was improved
to show a specific error for existing file,
and a generic error for other errors.