Allow specifying human readable value for option memory_limit
again (#4049)
This commit is contained in:
parent
45c1ae0ac1
commit
997fa3b2b7
1 changed files with 3 additions and 1 deletions
|
@ -562,6 +562,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]
|
||||
|
||||
|
@ -1853,7 +1855,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