mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Support string whitelist/blacklist
This commit is contained in:
parent
744487864d
commit
0c592ab552
1 changed files with 4 additions and 0 deletions
|
@ -1301,6 +1301,8 @@ def check_whitelist_blacklist(value, whitelist=None, blacklist=None):
|
|||
in_whitelist = False
|
||||
in_blacklist = False
|
||||
if whitelist:
|
||||
if not isinstance(whitelist, list):
|
||||
whitelist = [whitelist]
|
||||
try:
|
||||
for expr in whitelist:
|
||||
if expr_match(value, expr):
|
||||
|
@ -1313,6 +1315,8 @@ def check_whitelist_blacklist(value, whitelist=None, blacklist=None):
|
|||
whitelist = None
|
||||
|
||||
if blacklist:
|
||||
if not isinstance(blacklist, list):
|
||||
blacklist = [blacklist]
|
||||
try:
|
||||
for expr in blacklist:
|
||||
if expr_match(value, expr):
|
||||
|
|
Loading…
Add table
Reference in a new issue