Don't set cpuset_cpus if empty

If cpuset_cpus is set to '', we don't want to configure it, just skip
it.

Closes-Bug: #1867357
Change-Id: I615c798bdbcc0115f0ca9642969193ceada9b9cd
(cherry picked from commit 7bb9471423)
(cherry picked from commit 37ac1e99a6)
(cherry picked from commit 22315435e4)
This commit is contained in:
Emilien Macchi 2020-03-13 11:16:49 -04:00
parent 5fa3028d11
commit 811db58e98
1 changed files with 1 additions and 1 deletions

View File

@ -195,7 +195,7 @@ class ComposeV1Builder(object):
cmd.append('--cpu-shares=%s' % cconfig['cpu_shares'])
if 'security_opt' in cconfig:
cmd.append('--security-opt=%s' % cconfig['security_opt'])
if 'cpuset_cpus' in cconfig:
if 'cpuset_cpus' in cconfig and cconfig['cpuset_cpus'] != '':
# 'all' is a special value to directly configure all CPUs
# that are available.
if cconfig['cpuset_cpus'] == 'all':