mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-05 03:37:01 +00:00
fix couple of f-string mishaps (#11229)
* fix couple of f-string mishaps * add changelog frag * fix insanity
This commit is contained in:
parent
379db770c5
commit
f27839673c
4 changed files with 6 additions and 3 deletions
4
changelogs/fragments/11229-fstr-mishaps.yml
Normal file
4
changelogs/fragments/11229-fstr-mishaps.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
bugfixes:
|
||||
- pam_limits - remove ``%`` templating no longer used in f-string (https://github.com/ansible-collections/community.general/pull/11229).
|
||||
minor_changes:
|
||||
- spectrum_model_attrs - convert ``%`` templating to f-string (https://github.com/ansible-collections/community.general/pull/11229).
|
||||
|
|
@ -158,7 +158,7 @@ def _assert_is_valid_value(module, item, value, prefix=""):
|
|||
module.fail_json(
|
||||
msg=f"{prefix} Value of {value!r} for item {item!r} is invalid. Value must either be 'unlimited', 'infinity' or -1, all of "
|
||||
"which indicate no limit, or a limit of 0 or larger. Refer to the limits.conf(5) manual pages for "
|
||||
"more details." % (prefix, value, item)
|
||||
"more details."
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ class spectrum_model_attrs:
|
|||
rqstd_attrs = ""
|
||||
for ra in ret_attrs:
|
||||
_id = self.attr_id(ra) or ra
|
||||
rqstd_attrs += '<rs:requested-attribute id="%s" />' % (self.attr_id(ra) or ra)
|
||||
rqstd_attrs = f'{rqstd_attrs}<rs:requested-attribute id="{_id}" />'
|
||||
|
||||
# Build the complete XML search query for HTTP POST.
|
||||
xml = f"""<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
|
|
|||
|
|
@ -583,7 +583,6 @@ def split_xpath_last(xpath):
|
|||
def nsnameToClark(name, namespaces):
|
||||
if ":" in name:
|
||||
(nsname, rawname) = name.split(":")
|
||||
# return "{{%s}}%s" % (namespaces[nsname], rawname)
|
||||
return f"{{{namespaces[nsname]}}}{rawname}"
|
||||
|
||||
# no namespace name here
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue