diff --git a/changelogs/fragments/11229-fstr-mishaps.yml b/changelogs/fragments/11229-fstr-mishaps.yml new file mode 100644 index 0000000000..8d8589f605 --- /dev/null +++ b/changelogs/fragments/11229-fstr-mishaps.yml @@ -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). diff --git a/plugins/modules/pam_limits.py b/plugins/modules/pam_limits.py index 85a0784424..5bc0239c25 100644 --- a/plugins/modules/pam_limits.py +++ b/plugins/modules/pam_limits.py @@ -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." ) diff --git a/plugins/modules/spectrum_model_attrs.py b/plugins/modules/spectrum_model_attrs.py index b3b0a66cd4..88799eecbd 100644 --- a/plugins/modules/spectrum_model_attrs.py +++ b/plugins/modules/spectrum_model_attrs.py @@ -348,7 +348,7 @@ class spectrum_model_attrs: rqstd_attrs = "" for ra in ret_attrs: _id = self.attr_id(ra) or ra - rqstd_attrs += '' % (self.attr_id(ra) or ra) + rqstd_attrs = f'{rqstd_attrs}' # Build the complete XML search query for HTTP POST. xml = f""" diff --git a/plugins/modules/xml.py b/plugins/modules/xml.py index d94a02032b..b73d70f1fb 100644 --- a/plugins/modules/xml.py +++ b/plugins/modules/xml.py @@ -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