Convert packaging/* to py3/py2.4 syntax (#3702)

This commit is contained in:
Michael Scherer 2016-05-20 16:48:10 +02:00 committed by Matt Clay
parent cd09aab9b4
commit b8175f70ce
5 changed files with 37 additions and 20 deletions

View file

@ -475,7 +475,8 @@ def main():
if pool != '^$':
try:
result = rhn.update_subscriptions(pool)
except Exception, e:
except Exception:
e = get_exception()
module.fail_json(msg="Failed to update subscriptions for '%s': %s" % (server_hostname, e))
else:
module.exit_json(**result)
@ -488,7 +489,8 @@ def main():
rhn.register(username, password, autosubscribe, activationkey, org_id,
consumer_type, consumer_name, consumer_id)
subscribed_pool_ids = rhn.subscribe(pool)
except Exception, e:
except Exception:
e = get_exception()
module.fail_json(msg="Failed to register with '%s': %s" % (server_hostname, e))
else:
module.exit_json(changed=True,
@ -502,7 +504,8 @@ def main():
try:
rhn.unsubscribe()
rhn.unregister()
except Exception, e:
except Exception:
e = get_exception()
module.fail_json(msg="Failed to unregister: %s" % e)
else:
module.exit_json(changed=True, msg="System successfully unregistered from %s." % server_hostname)