mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-24 12:49:03 +00:00
Replace % string formatting with f-strings across multiple plugins (#11908)
* Replace % string formatting with f-strings across multiple plugins Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Add changelog fragment for PR 11908 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
253ac45dd3
commit
53397c081a
14 changed files with 65 additions and 64 deletions
|
|
@ -45,12 +45,6 @@ class Repos:
|
|||
_SUBMAN_OUT_HEADER = """+----------------------------------------------------------+
|
||||
Available Repositories in /etc/yum.repos.d/redhat.repo
|
||||
+----------------------------------------------------------+
|
||||
"""
|
||||
_SUBMAN_OUT_ENTRY = """Repo ID: %s
|
||||
Repo Name: %s
|
||||
Repo URL: %s
|
||||
Enabled: %s
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, repos):
|
||||
|
|
@ -62,11 +56,12 @@ Enabled: %s
|
|||
"""
|
||||
out = self._SUBMAN_OUT_HEADER
|
||||
for repo in self.repos:
|
||||
out += self._SUBMAN_OUT_ENTRY % (
|
||||
repo["id"],
|
||||
repo["name"],
|
||||
repo["url"],
|
||||
"1" if repo["enabled"] else "0",
|
||||
out += (
|
||||
f"Repo ID: {repo['id']}\n"
|
||||
f"Repo Name: {repo['name']}\n"
|
||||
f"Repo URL: {repo['url']}\n"
|
||||
f"Enabled: {'1' if repo['enabled'] else '0'}\n"
|
||||
"\n"
|
||||
)
|
||||
|
||||
return out
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue