Skip to content

Commit

Permalink
Fix CLI list output export issue (Sceptre#667)
Browse files Browse the repository at this point in the history
Fixed issue where it would failed to export if the output contains a string with spaces or other special characters.
  • Loading branch information
jfgiroux authored and thawkson committed Feb 6, 2021
1 parent 4fd9cdd commit b13fda7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sceptre/cli/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def list_outputs(ctx, path, export):
for response in responses:
for stack in response.values():
for output in stack:
write("export SCEPTRE_{0}={1}".format(
write("export SCEPTRE_{0}='{1}'".format(
output.get("OutputKey"),
output.get("OutputValue")
), 'str')
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def test_list_outputs_with_export(self):
cli, ["list", "outputs", "dev/vpc.yaml", "-e", "envvar"]
)
assert result.exit_code == 0
assert yaml.safe_load(result.output) == "export SCEPTRE_Key=Value"
assert yaml.safe_load(result.output) == "export SCEPTRE_Key='Value'"

def test_status_with_group(self):
self.mock_stack_actions.get_status.return_value = {
Expand Down

0 comments on commit b13fda7

Please sign in to comment.