mirror of https://github.com/docker/compose.git
Implement review suggestions.
Signed-off-by: Alexey Rokhin <arokhin@mail.ru>
This commit is contained in:
parent
aeeed0cf2f
commit
b815a00e33
|
@ -78,7 +78,7 @@
|
|||
"cpu_percent": {"type": "integer", "minimum": 0, "maximum": 100},
|
||||
"cpu_shares": {"type": ["number", "string"]},
|
||||
"cpu_quota": {"type": ["number", "string"]},
|
||||
"cpus": {"type": ["number", "string"], "minimum": 0},
|
||||
"cpus": {"type": "number", "minimum": 0},
|
||||
"cpuset": {"type": "string"},
|
||||
"depends_on": {
|
||||
"oneOf": [
|
||||
|
|
|
@ -803,7 +803,10 @@ class Service(object):
|
|||
|
||||
nano_cpus = None
|
||||
if 'cpus' in options:
|
||||
nano_cpus = int(options.get('cpus') * 1000000000)
|
||||
nano_cpus = options.get('cpus') * 1000000000
|
||||
if isinstance(nano_cpus, float) and not nano_cpus.is_integer():
|
||||
raise ValueError("cpus is too precise")
|
||||
nano_cpus = int(nano_cpus)
|
||||
|
||||
return self.client.create_host_config(
|
||||
links=self._get_links(link_to_self=one_off),
|
||||
|
|
Loading…
Reference in New Issue