Skip to content

Commit

Permalink
Merge pull request #161 from remind101/strip_spaces_multi_params
Browse files Browse the repository at this point in the history
Remove spaces from multi-item parameters
  • Loading branch information
phobologic committed Jun 10, 2016
2 parents c53f635 + 1f93701 commit 8a86179
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions stacker/actions/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 8 additions & 1 deletion stacker/tests/actions/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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'}
Expand Down

0 comments on commit 8a86179

Please sign in to comment.