Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into debian
Browse files Browse the repository at this point in the history
  • Loading branch information
volans- committed Sep 26, 2017
2 parents 0da95a6 + ab33903 commit b191fc7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CUMIN CHANGELOG


## v1.1.1 (2017-09-26)

### Bug Fixes:
* OpenStack: limit grammar to not overlap with the global one


## v1.1.0 (2017-09-21)

### New features:
Expand Down
4 changes: 2 additions & 2 deletions cumin/backends/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def grammar():
quoted_string = pp.quotedString.copy().addParseAction(pp.removeQuotes) # Both single and double quotes are allowed

# Key-value tokens: key:value
# All printables characters except the parentheses that are part of this or the global grammar
key = pp.Word(pp.alphanums + '-_.')('key')
# Lowercase key, all printable characters except the parentheses that are part of the global grammar for the value
key = pp.Word(pp.srange('[a-z0-9-_.]"'), min=2)('key')
all_but_par = ''.join([c for c in pp.printables if c not in ('(', ')', '{', '}')])
value = (quoted_string | pp.Word(all_but_par))('value')
item = pp.Combine(key + ':' + value)
Expand Down
5 changes: 5 additions & 0 deletions cumin/tests/fixtures/backends/grammars/openstack_invalid.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ key:value key
key:value :value
"key":value
key%:value
A:value
a:value
KEY:value
Key:value
kEy:value
1 change: 1 addition & 0 deletions cumin/tests/fixtures/backends/grammars/openstack_valid.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ project:project_name
project:"Project Name"
project:project_name name:host1
project:"Project Name" name:host1
ip:value

0 comments on commit b191fc7

Please sign in to comment.