mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
[PR #11106/f785e9c7 backport][stable-12] replace batch of redundant to_native()/to_text() occurrences (#11140)
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
(cherry picked from commit f785e9c780)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
@@ -90,7 +90,6 @@ EXAMPLES = r"""
|
||||
import os
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
|
||||
|
||||
class Hg:
|
||||
@@ -123,14 +122,14 @@ class Hg:
|
||||
if rc != 0:
|
||||
self.module.fail_json(msg=err)
|
||||
else:
|
||||
return to_native(out).strip("\n")
|
||||
return out.strip("\n")
|
||||
|
||||
def get_remote_revision(self):
|
||||
(rc, out, err) = self._command(["id", self.repo])
|
||||
if rc != 0:
|
||||
self.module.fail_json(msg=err)
|
||||
else:
|
||||
return to_native(out).strip("\n")
|
||||
return out.strip("\n")
|
||||
|
||||
def has_local_mods(self):
|
||||
now = self.get_revision()
|
||||
|
||||
Reference in New Issue
Block a user