mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-24 12:49:03 +00:00
replace batch of redundant to_native()/to_text() occurrences (#11106)
* replace batch of redundant to_native()/to_text() occurrences * add changelog frag * snap sanity * rolling back snap for now * more cases in redhat_subscription
This commit is contained in:
parent
9b8867399e
commit
f785e9c780
14 changed files with 47 additions and 45 deletions
|
|
@ -1151,7 +1151,7 @@ def main():
|
|||
try:
|
||||
syspurpose_changed = SysPurpose().update_syspurpose(syspurpose)
|
||||
except Exception as err:
|
||||
module.fail_json(msg=f"Failed to update syspurpose attributes: {to_native(err)}")
|
||||
module.fail_json(msg=f"Failed to update syspurpose attributes: {err}")
|
||||
|
||||
# Ensure system is registered
|
||||
if state == "present":
|
||||
|
|
@ -1164,12 +1164,12 @@ def main():
|
|||
try:
|
||||
rhsm.sync_syspurpose()
|
||||
except Exception as e:
|
||||
module.fail_json(msg=f"Failed to synchronize syspurpose attributes: {to_native(e)}")
|
||||
module.fail_json(msg=f"Failed to synchronize syspurpose attributes: {e}")
|
||||
if pool_ids:
|
||||
try:
|
||||
result = rhsm.update_subscriptions_by_pool_ids(pool_ids)
|
||||
except Exception as e:
|
||||
module.fail_json(msg=f"Failed to update subscriptions for '{server_hostname}': {to_native(e)}")
|
||||
module.fail_json(msg=f"Failed to update subscriptions for '{server_hostname}': {e}")
|
||||
else:
|
||||
module.exit_json(**result)
|
||||
else:
|
||||
|
|
@ -1207,7 +1207,7 @@ def main():
|
|||
else:
|
||||
subscribed_pool_ids = []
|
||||
except Exception as e:
|
||||
module.fail_json(msg=f"Failed to register with '{server_hostname}': {to_native(e)}")
|
||||
module.fail_json(msg=f"Failed to register with '{server_hostname}': {e}")
|
||||
else:
|
||||
module.exit_json(
|
||||
changed=True,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue