From fb1385bbd9b64ca208d7159843cd22cc9dc8969c Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 23 May 2014 12:44:01 -0700 Subject: [PATCH] Replace CommandException with Exception --- library/packaging/redhat_subscription | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/packaging/redhat_subscription b/library/packaging/redhat_subscription index f9918ada4b0..5ce489bdbc8 100644 --- a/library/packaging/redhat_subscription +++ b/library/packaging/redhat_subscription @@ -372,7 +372,7 @@ def main(): rhn.configure(**module.params) rhn.register(username, password, autosubscribe, activationkey) rhn.subscribe(pool) - except CommandException, e: + except Exception, e: module.fail_json(msg="Failed to register with '%s': %s" % (server_hostname, e)) else: module.exit_json(changed=True, msg="System successfully registered to '%s'." % server_hostname) @@ -385,7 +385,7 @@ def main(): try: rhn.unsubscribe() rhn.unregister() - except CommandException, e: + except Exception, e: module.fail_json(msg="Failed to unregister: %s" % e) else: module.exit_json(changed=True, msg="System successfully unregistered from %s." % server_hostname)