mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-26 21:33:12 +00:00
use f-strings in module utils (#10901)
* use f-strings in module utils * Apply suggestions from code review Co-authored-by: Felix Fontein <felix@fontein.de> * remove unused imports --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@@ -20,7 +20,7 @@ def convert_to_binary_multiple(size_with_unit):
|
||||
if float(size) < 0:
|
||||
return -1
|
||||
if not valid_unit:
|
||||
raise ValueError("%s does not have a valid unit. The unit must be one of %s" % (size_with_unit, valid_units))
|
||||
raise ValueError(f"{size_with_unit} does not have a valid unit. The unit must be one of {valid_units}")
|
||||
|
||||
size = size_with_unit.replace(" ", "").split('iB')[0]
|
||||
size_kib = basic.human_to_bytes(size)
|
||||
|
||||
Reference in New Issue
Block a user