Allow specifying human readable value for option memory_limit
again (#4049)
This commit is contained in:
parent
53a0a64bda
commit
fc87dd9650
1 changed files with 3 additions and 1 deletions
|
@ -566,6 +566,8 @@ def _human_to_bytes(number):
|
|||
|
||||
if isinstance(number, int):
|
||||
return number
|
||||
if number.isdigit():
|
||||
return int(number)
|
||||
if number[-1] == suffixes[0] and number[-2].isdigit():
|
||||
return number[:-1]
|
||||
|
||||
|
@ -1870,7 +1872,7 @@ def main():
|
|||
volumes_from = dict(default=None, type='list'),
|
||||
links = dict(default=None, type='list'),
|
||||
devices = dict(default=None, type='list'),
|
||||
memory_limit = dict(default=0, type='int'),
|
||||
memory_limit = dict(default=0),
|
||||
memory_swap = dict(default=0, type='int'),
|
||||
cpu_shares = dict(default=0, type='int'),
|
||||
docker_url = dict(),
|
||||
|
|
Loading…
Reference in a new issue