Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with parsing #1183

Merged
merged 3 commits into from
Feb 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Next Release (TBD)
* feature:``aws cloudtrail``: Add support for regionalized policy templates
for the ``create-subscription`` and ``update-subscription`` commands.
(`issue 1167 <https://github.com/aws/aws-cli/pull/1167>`__)
* bugfix:parsing: Fix issue where if there is a square bracket inside one
of the values of a list, the end character would get removed.
(`issue 1183 <https://github.com/aws/aws-cli/pull/1183>`__)


1.7.12
======
Expand Down
2 changes: 1 addition & 1 deletion awscli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _eat_items(value, iter_parts, part, end_char, replace_char=''):
except StopIteration:
raise ValueError(value)
chunks.append(current.replace(replace_char, ''))
if end_char in current:
if current.endswith(end_char):
break
return ','.join(chunks)

Expand Down
4 changes: 4 additions & 0 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,7 @@ def test_missing_bracket2(self):
def test_bracket_in_middle(self):
self.assertEqual(split_on_commas('foo,bar=a[b][c],baz'),
['foo', 'bar=a[b][c]', 'baz'])

def test_end_bracket_in_value(self):
self.assertEqual(split_on_commas('foo,bar=[foo,*[biz]*,baz]'),
['foo', 'bar=foo,*[biz]*,baz'])