mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add function to search for substr in list
This commit is contained in:
parent
007eef84d7
commit
7f141ba38c
1 changed files with 7 additions and 0 deletions
|
@ -3010,3 +3010,10 @@ def str_version_to_evr(verstring):
|
|||
release = ''
|
||||
|
||||
return epoch, version, release
|
||||
|
||||
def substr_in_list(string_to_search_for, list_to_search):
|
||||
'''
|
||||
Return a boolean value that indicates whether or not a given
|
||||
string is present in any of the strings which comprise a list
|
||||
'''
|
||||
return any(string_to_search_for in s for s in list_to_search)
|
||||
|
|
Loading…
Add table
Reference in a new issue