Merge "Zun: fix an issue on command property"
This commit is contained in:
commit
1616c09b13
|
@ -12,6 +12,7 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
import shlex
|
||||||
|
|
||||||
from heat.common import exception
|
from heat.common import exception
|
||||||
from heat.common.i18n import _
|
from heat.common.i18n import _
|
||||||
|
@ -316,6 +317,9 @@ class Container(resource.Resource,
|
||||||
networks = args.pop(self.NETWORKS, None)
|
networks = args.pop(self.NETWORKS, None)
|
||||||
if networks:
|
if networks:
|
||||||
args['nets'] = self._build_nets(networks)
|
args['nets'] = self._build_nets(networks)
|
||||||
|
command = args.pop(self.COMMAND, None)
|
||||||
|
if command:
|
||||||
|
args['command'] = shlex.split(command)
|
||||||
container = self.client().containers.run(**args)
|
container = self.client().containers.run(**args)
|
||||||
self.resource_id_set(container.uuid)
|
self.resource_id_set(container.uuid)
|
||||||
return container.uuid
|
return container.uuid
|
||||||
|
|
|
@ -274,7 +274,7 @@ class ZunContainerTest(common.HeatTestCase):
|
||||||
self.client.containers.run.assert_called_once_with(
|
self.client.containers.run.assert_called_once_with(
|
||||||
name=self.fake_name,
|
name=self.fake_name,
|
||||||
image=self.fake_image,
|
image=self.fake_image,
|
||||||
command=self.fake_command,
|
command=self.fake_command.split(),
|
||||||
cpu=self.fake_cpu,
|
cpu=self.fake_cpu,
|
||||||
memory=self.fake_memory,
|
memory=self.fake_memory,
|
||||||
environment=self.fake_env,
|
environment=self.fake_env,
|
||||||
|
|
Loading…
Reference in New Issue