Skip to content

Commit

Permalink
Merge pull request #1183 from kyleknap/splitting-quotes
Browse files Browse the repository at this point in the history
Fix issue with parsing
  • Loading branch information
kyleknap committed Feb 25, 2015
2 parents 8379c3c + 248d917 commit 3568ce6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
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'])

0 comments on commit 3568ce6

Please sign in to comment.