diff --git a/stacker/actions/build.py b/stacker/actions/build.py index a88994b09..a1bfbb138 100644 --- a/stacker/actions/build.py +++ b/stacker/actions/build.py @@ -87,6 +87,7 @@ def resolve_parameters(parameters, blueprint, context, provider): v_list = [] values = value.split(',') for v in values: + v = v.strip() stack_name, output = v.split('::') stack_fqn = context.get_fqn(stack_name) try: diff --git a/stacker/tests/actions/test_build.py b/stacker/tests/actions/test_build.py index 1bd67df38..576b8da12 100644 --- a/stacker/tests/actions/test_build.py +++ b/stacker/tests/actions/test_build.py @@ -40,7 +40,6 @@ def get_outputs(self, stack_name, *args, **kwargs): class TestBuildAction(unittest.TestCase): - def setUp(self): self.context = Context({'namespace': 'namespace'}) self.build_action = build.Action(self.context, provider=TestProvider()) @@ -308,6 +307,14 @@ def get_output(stack, param): self.assertEqual(p["a"], "Apple,Carrot") self.assertEqual(p["b"], "Banana") + # Test multi-output with spaces + params = {"a": "other-stack::a, other-stack::c", "b": "Banana"} + self.prov.get_output.side_effect = get_output + p = resolve_parameters(params, self.bp, self.ctx, self.prov) + self.assertEqual(self.prov.get_output.call_count, 4) + self.assertEqual(p["a"], "Apple,Carrot") + self.assertEqual(p["b"], "Banana") + def test_resolve_parameters_output_does_not_exist(self): def get_output(stack, param): d = {'c': 'Carrot'}