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: Ia9f4d535b9b633e703465f155c4722d9a58c45a7
This commit is contained in:
parent
1713ee675c
commit
0a38b6c568
@ -494,5 +494,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
|
||||
|
@ -59,5 +59,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
|
||||
|
@ -100,5 +100,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
|
||||
|
@ -39,7 +39,7 @@ class LayoutSchema(object):
|
||||
'email': str,
|
||||
'older-than': str,
|
||||
'newer-than': str,
|
||||
}, extra=True)
|
||||
}, extra=v.ALLOW_EXTRA)
|
||||
|
||||
require = {'approval': toList(approval),
|
||||
'open': bool,
|
||||
|
@ -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'):
|
||||
|
@ -134,7 +134,7 @@ def getSchema():
|
||||
'email': str,
|
||||
'older-than': str,
|
||||
'newer-than': str,
|
||||
}, extra=True)
|
||||
}, extra=v.ALLOW_EXTRA)
|
||||
|
||||
zuul_trigger = {
|
||||
v.Required('event'):
|
||||
|
Loading…
Reference in New Issue
Block a user