mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Pylint fixes for PR #29139
This commit is contained in:
parent
e010f2d3b5
commit
56b3302fe9
@ -143,6 +143,7 @@ class RosterMatcher(object):
|
||||
return self.raw[minion]
|
||||
return False
|
||||
|
||||
|
||||
def _convert_range_to_list(tgt, range_server):
|
||||
'''
|
||||
convert a seco.range range into a list target
|
||||
@ -151,5 +152,5 @@ def _convert_range_to_list(tgt, range_server):
|
||||
try:
|
||||
return r.expand(tgt)
|
||||
except seco.range.RangeException as err:
|
||||
print('Range server exception: {0}'.format(err))
|
||||
log.error('Range server exception: %s', err)
|
||||
return []
|
||||
|
@ -11,7 +11,7 @@ When you want to use a range query for target matching, use ``--roster range``.
|
||||
salt-ssh --roster range '%%%example.range.cluster' test.ping
|
||||
|
||||
'''
|
||||
|
||||
from __future__ import absolute_import
|
||||
import fnmatch
|
||||
|
||||
import logging
|
||||
@ -26,9 +26,11 @@ except ImportError:
|
||||
log.error("Unable to load range library")
|
||||
# pylint: enable=import-error
|
||||
|
||||
|
||||
def __virtual__():
|
||||
return HAS_RANGE
|
||||
|
||||
|
||||
def targets(tgt, tgt_type='range', **kwargs):
|
||||
'''
|
||||
Return the targets from a range query
|
||||
@ -62,8 +64,10 @@ def targets(tgt, tgt_type='range', **kwargs):
|
||||
|
||||
return targeted_hosts
|
||||
|
||||
|
||||
def target_range(tgt, hosts):
|
||||
return {host: {'host': host, 'user': __opts__['ssh_user']} for host in hosts}
|
||||
return dict((host, {'host': host, 'user': __opts__['ssh_user']}) for host in hosts)
|
||||
|
||||
|
||||
def target_glob(tgt, hosts):
|
||||
return {host: {'host': host, 'user': __opts__['ssh_user']} for host in hosts if fnmatch.fnmatch(tgt, host)}
|
||||
return dict((host, {'host': host, 'user': __opts__['ssh_user']}) for host in hosts if fnmatch.fnmatch(tgt, host))
|
||||
|
Loading…
Reference in New Issue
Block a user