Allow specifying human readable value for option `memory_limit` again (#4049)

pull/18777/head
PikachuEXE 8 years ago committed by Matt Clay
parent 53a0a64bda
commit fc87dd9650

@ -566,6 +566,8 @@ def _human_to_bytes(number):
if isinstance(number, int): if isinstance(number, int):
return number return number
if number.isdigit():
return int(number)
if number[-1] == suffixes[0] and number[-2].isdigit(): if number[-1] == suffixes[0] and number[-2].isdigit():
return number[:-1] return number[:-1]
@ -1870,7 +1872,7 @@ def main():
volumes_from = dict(default=None, type='list'), volumes_from = dict(default=None, type='list'),
links = dict(default=None, type='list'), links = dict(default=None, type='list'),
devices = 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'), memory_swap = dict(default=0, type='int'),
cpu_shares = dict(default=0, type='int'), cpu_shares = dict(default=0, type='int'),
docker_url = dict(), docker_url = dict(),

Loading…
Cancel
Save