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
This commit is contained in:
parent
6bf30006c0
commit
7bb9471423
|
@ -82,7 +82,7 @@ class ComposeV1Builder(base.BaseBuilder):
|
||||||
for extra_host in cconfig.get('extra_hosts', []):
|
for extra_host in cconfig.get('extra_hosts', []):
|
||||||
if extra_host:
|
if extra_host:
|
||||||
cmd.append('--add-host=%s' % extra_host)
|
cmd.append('--add-host=%s' % extra_host)
|
||||||
if 'cpuset_cpus' in cconfig:
|
if 'cpuset_cpus' in cconfig and cconfig['cpuset_cpus'] != '':
|
||||||
# 'all' is a special value to directly configure all CPUs
|
# 'all' is a special value to directly configure all CPUs
|
||||||
# that are available.
|
# that are available.
|
||||||
if cconfig['cpuset_cpus'] == 'all':
|
if cconfig['cpuset_cpus'] == 'all':
|
||||||
|
|
|
@ -91,7 +91,7 @@ class PodmanBuilder(base.BaseBuilder):
|
||||||
for extra_host in cconfig.get('extra_hosts', []):
|
for extra_host in cconfig.get('extra_hosts', []):
|
||||||
if extra_host:
|
if extra_host:
|
||||||
cmd.append('--add-host=%s' % extra_host)
|
cmd.append('--add-host=%s' % extra_host)
|
||||||
if 'cpuset_cpus' in cconfig:
|
if 'cpuset_cpus' in cconfig and cconfig['cpuset_cpus'] != '':
|
||||||
# 'all' is a special value to directly configure all CPUs
|
# 'all' is a special value to directly configure all CPUs
|
||||||
# that are available.
|
# that are available.
|
||||||
if cconfig['cpuset_cpus'] == 'all':
|
if cconfig['cpuset_cpus'] == 'all':
|
||||||
|
|
|
@ -36,6 +36,7 @@ class TestBaseBuilder(base.TestCase):
|
||||||
'one': {
|
'one': {
|
||||||
'start_order': 0,
|
'start_order': 0,
|
||||||
'image': 'centos:7',
|
'image': 'centos:7',
|
||||||
|
'cpuset_cpus': '',
|
||||||
},
|
},
|
||||||
'two': {
|
'two': {
|
||||||
'start_order': 1,
|
'start_order': 1,
|
||||||
|
|
Loading…
Reference in New Issue