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())
|
||||
|
||||
# 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)
|
||||
elif param.isdigit():
|
||||
return int(param) * 2**10
|
||||
|
|
Loading…
Reference in a new issue