mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 18:06:25 +00:00
modules bc*: use f-strings (#10945)
* modules bc*: use f-strings * no quotes or backticks inside f-strs * add changelog frag * rename chglof frag file * rename chglof frag file * copr: re-applied change maintain original logic
This commit is contained in:
parent
f9b4abf930
commit
0ef2235929
31 changed files with 197 additions and 202 deletions
|
|
@ -153,12 +153,12 @@ def normalize_ttl(ttl):
|
|||
new_ttl = ""
|
||||
hours, remainder = divmod(ttl, 3600)
|
||||
if hours:
|
||||
new_ttl += "{0}h".format(hours)
|
||||
new_ttl += f"{hours}h"
|
||||
minutes, seconds = divmod(remainder, 60)
|
||||
if minutes:
|
||||
new_ttl += "{0}m".format(minutes)
|
||||
new_ttl += f"{minutes}m"
|
||||
if seconds:
|
||||
new_ttl += "{0}s".format(seconds)
|
||||
new_ttl += f"{seconds}s"
|
||||
return new_ttl
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue