mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
swapping out if...else approach for __opts__.get approach.
This commit is contained in:
parent
aa2c626cdf
commit
6a5b5b28e2
2 changed files with 2 additions and 8 deletions
|
@ -25,10 +25,7 @@ def match(tgt):
|
|||
'''
|
||||
nodegroups = __opts__.get('nodegroups', {})
|
||||
matchers = salt.loader.matchers(__opts__)
|
||||
if 'minion_id' in __opts__:
|
||||
minion_id = __opts__['minion_id']
|
||||
else:
|
||||
minion_id = __opts__['id']
|
||||
minion_id = __opts__.get(['minion_id'], __opts__['id'])
|
||||
|
||||
if not isinstance(tgt, six.string_types) and not isinstance(tgt, (list, tuple)):
|
||||
log.error('Compound target received that is neither string, list nor tuple')
|
||||
|
|
|
@ -12,10 +12,7 @@ def match(tgt):
|
|||
'''
|
||||
Returns true if the passed glob matches the id
|
||||
'''
|
||||
if 'minion_id' in __opts__:
|
||||
minion_id = __opts__['minion_id']
|
||||
else:
|
||||
minion_id = __opts__['id']
|
||||
minion_id = __opts__.get('minion_id', __opts__['id'])
|
||||
if not isinstance(tgt, six.string_types):
|
||||
return False
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue