Skip to content

Commit 80c41ec

Browse files
authored
fix: Accept hyphens in values of scope (#160)
1 parent 8c918a1 commit 80c41ec

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sdcclient/monitor/dashboard_converters/_dashboard_scope.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ def convert_scope_string_to_expression(scope = None):
4747
;
4848
4949
word =
50-
| /[\w\.]+/
51-
| '"' /[\w\.]+/ '"'
52-
| "'" /[\w\.]+/ "'"
50+
| /[a-zA-Z0-9-_\-\.]+/
51+
| '"' /[a-zA-Z0-9-_\-\.]+/ '"'
52+
| "'" /[a-zA-Z0-9-_\-\.]+/ "'"
5353
;
5454
"""
5555

specs/monitor/dashboard_converters/dashboard_scope_spec.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
"value": ["foo"]
3838
}]]))
3939

40-
with it('parses correctly: cluster.id-number = "foo"'):
41-
param = 'cluster.id-number = "foo"'
40+
with it('parses correctly: cluster.id-number = "foo-bar"'):
41+
param = 'cluster.id-number = "foo-bar"'
4242
res = convert_scope_string_to_expression(param)
4343
expect(res).to(equal([True, [{
4444
"displayName": "",
4545
"isVariable": False,
4646
"operand": "cluster.id-number",
4747
"operator": "equals",
48-
"value": ["foo"]
48+
"value": ["foo-bar"]
4949
}]]))
5050

5151
with it("parses correctly: agent.id = 'foo'"):

0 commit comments

Comments
 (0)