Handle dict extras in Voluptuous Schema
Not sure if schema requirements changed but it is no longer valid to
use:
Schema({}, extra=True)
The docs say that should be avoided and instead you should use:
Schema(dict)
To indicate a dict that can have any key: value pairs. Additionally
extra=True appears to be replaced with extra=ALLOW_EXTRA so update that
in cases where we have some subset of desired keys.
Change-Id: I3dc966dae534416f2b601ec8d299e1d0e3651e7b
This commit is contained in:
@@ -582,7 +582,7 @@ class PipelineParser(object):
|
||||
'email': str,
|
||||
'older-than': str,
|
||||
'newer-than': str,
|
||||
}, extra=True)
|
||||
}, extra=vs.ALLOW_EXTRA)
|
||||
|
||||
require = {'approval': to_list(approval),
|
||||
'open': bool,
|
||||
|
||||
@@ -819,5 +819,5 @@ class GerritConnection(BaseConnection):
|
||||
|
||||
|
||||
def getSchema():
|
||||
gerrit_connection = v.Any(str, v.Schema({}, extra=True))
|
||||
gerrit_connection = v.Any(str, v.Schema(dict))
|
||||
return gerrit_connection
|
||||
|
||||
@@ -48,5 +48,5 @@ class GerritReporter(BaseReporter):
|
||||
|
||||
|
||||
def getSchema():
|
||||
gerrit_reporter = v.Any(str, v.Schema({}, extra=True))
|
||||
gerrit_reporter = v.Any(str, v.Schema(dict))
|
||||
return gerrit_reporter
|
||||
|
||||
@@ -82,14 +82,14 @@ def validate_conf(trigger_conf):
|
||||
def getSchema():
|
||||
def toList(x):
|
||||
return v.Any([x], x)
|
||||
variable_dict = v.Schema({}, extra=True)
|
||||
variable_dict = v.Schema(dict)
|
||||
|
||||
approval = v.Schema({'username': str,
|
||||
'email-filter': str,
|
||||
'email': str,
|
||||
'older-than': str,
|
||||
'newer-than': str,
|
||||
}, extra=True)
|
||||
}, extra=v.ALLOW_EXTRA)
|
||||
|
||||
gerrit_trigger = {
|
||||
v.Required('event'):
|
||||
|
||||
@@ -59,5 +59,5 @@ class GitConnection(BaseConnection):
|
||||
|
||||
|
||||
def getSchema():
|
||||
git_connection = v.Any(str, v.Schema({}, extra=True))
|
||||
git_connection = v.Any(str, v.Schema(dict))
|
||||
return git_connection
|
||||
|
||||
@@ -58,5 +58,5 @@ class SMTPConnection(BaseConnection):
|
||||
|
||||
|
||||
def getSchema():
|
||||
smtp_connection = v.Any(str, v.Schema({}, extra=True))
|
||||
smtp_connection = v.Any(str, v.Schema(dict))
|
||||
return smtp_connection
|
||||
|
||||
@@ -101,5 +101,5 @@ class SQLConnection(BaseConnection):
|
||||
|
||||
|
||||
def getSchema():
|
||||
sql_connection = v.Any(str, v.Schema({}, extra=True))
|
||||
sql_connection = v.Any(str, v.Schema(dict))
|
||||
return sql_connection
|
||||
|
||||
@@ -63,7 +63,7 @@ def getSchema():
|
||||
'email': str,
|
||||
'older-than': str,
|
||||
'newer-than': str,
|
||||
}, extra=True)
|
||||
}, extra=v.ALLOW_EXTRA)
|
||||
|
||||
zuul_trigger = {
|
||||
v.Required('event'):
|
||||
|
||||
Reference in New Issue
Block a user