From c497c484ae3c157c235ed6edb57c4a44aef5df27 Mon Sep 17 00:00:00 2001 From: Ananta Chakravartula Date: Tue, 27 Oct 2020 08:49:46 -0400 Subject: [PATCH] accept - in values of scope --- sdcclient/monitor/dashboard_converters/_dashboard_scope.py | 6 +++--- specs/monitor/dashboard_converters/dashboard_scope_spec.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdcclient/monitor/dashboard_converters/_dashboard_scope.py b/sdcclient/monitor/dashboard_converters/_dashboard_scope.py index e780b241..966d4334 100644 --- a/sdcclient/monitor/dashboard_converters/_dashboard_scope.py +++ b/sdcclient/monitor/dashboard_converters/_dashboard_scope.py @@ -47,9 +47,9 @@ def convert_scope_string_to_expression(scope = None): ; word = - | /[\w\.]+/ - | '"' /[\w\.]+/ '"' - | "'" /[\w\.]+/ "'" + | /[a-zA-Z0-9-_\-\.]+/ + | '"' /[a-zA-Z0-9-_\-\.]+/ '"' + | "'" /[a-zA-Z0-9-_\-\.]+/ "'" ; """ diff --git a/specs/monitor/dashboard_converters/dashboard_scope_spec.py b/specs/monitor/dashboard_converters/dashboard_scope_spec.py index 7d02d044..3ede5be6 100644 --- a/specs/monitor/dashboard_converters/dashboard_scope_spec.py +++ b/specs/monitor/dashboard_converters/dashboard_scope_spec.py @@ -37,15 +37,15 @@ "value": ["foo"] }]])) - with it('parses correctly: cluster.id-number = "foo"'): - param = 'cluster.id-number = "foo"' + with it('parses correctly: cluster.id-number = "foo-bar"'): + param = 'cluster.id-number = "foo-bar"' res = convert_scope_string_to_expression(param) expect(res).to(equal([True, [{ "displayName": "", "isVariable": False, "operand": "cluster.id-number", "operator": "equals", - "value": ["foo"] + "value": ["foo-bar"] }]])) with it("parses correctly: agent.id = 'foo'"):