mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-31 17:11:23 -07:00
validate memory parameter for ovirt_vm (#46698)
This commit is contained in:
parent
2a0c356da9
commit
57349c0611
1 changed files with 1 additions and 1 deletions
|
@ -181,7 +181,7 @@ def convert_to_bytes(param):
|
||||||
param = ''.join(param.split())
|
param = ''.join(param.split())
|
||||||
|
|
||||||
# Convert to bytes:
|
# Convert to bytes:
|
||||||
if param[-3].lower() in ['k', 'm', 'g', 't', 'p']:
|
if len(param) > 3 and param[-3].lower() in ['k', 'm', 'g', 't', 'p']:
|
||||||
return int(param[:-3]) * BYTES_MAP.get(param[-3:].lower(), 1)
|
return int(param[:-3]) * BYTES_MAP.get(param[-3:].lower(), 1)
|
||||||
elif param.isdigit():
|
elif param.isdigit():
|
||||||
return int(param) * 2**10
|
return int(param) * 2**10
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue