Merge "Remove query variable refresh deprecation"

This commit is contained in:
Zuul 2020-06-25 04:00:47 +00:00 committed by Gerrit Code Review
commit 5b98241e36
6 changed files with 7 additions and 12 deletions

View File

@ -23,18 +23,13 @@ LOG = logging.getLogger(__name__)
class Query(Base):
def validate_refresh(self, data):
v.Schema(v.Any(v.All(int, v.Range(min=0, max=2)), bool))(data)
if isinstance(data, bool):
LOG.warn('templating query refresh type bool is deprecated')
return data
def get_schema(self):
query = {
v.Required('includeAll', default=False): v.All(bool),
v.Required('multi', default=False): v.All(bool),
v.Required('query', default=''): v.All(str),
v.Required('refresh', default=0): self.validate_refresh,
v.Required('refresh', default=1): \
v.All(int, v.Range(min=0, max=2)),
v.Optional('datasource'): v.All(str),
v.Optional('hide'): v.All(int, v.Range(min=0, max=2)),
}

View File

@ -10,7 +10,7 @@
"multi": false,
"name": "foobar",
"query": "foobar.*",
"refresh": 0,
"refresh": 1,
"type": "query"
}
]

View File

@ -45,7 +45,7 @@
"multi": false,
"name": "hostname",
"query": "node*",
"refresh": true,
"refresh": 1,
"type": "query"
}
]

View File

@ -7,7 +7,7 @@ dashboard:
type: query
datasource: graphite
query: node*
refresh: true
refresh: 1
title: New dashboard
rows:
- title: New row

View File

@ -59,7 +59,7 @@
"multi": false,
"name": "hostname",
"query": "node*",
"refresh": true,
"refresh": 1,
"type": "query"
}
]

View File

@ -4,7 +4,7 @@ dashboard:
type: query
datasource: graphite
query: node*
refresh: true
refresh: 1
hide: 0
title: New dashboard
rows: