mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Lint error in publish
This commit is contained in:
parent
e22a3d2be6
commit
9bbe3c998b
1 changed files with 8 additions and 8 deletions
|
@ -78,26 +78,26 @@ def _publish(
|
|||
|
||||
if via_master:
|
||||
if 'master_uri_list' not in __opts__:
|
||||
raise SaltInvocationError(message='''Could not find list of
|
||||
masters in minion configuration but `via_master` was specified.''')
|
||||
raise SaltInvocationError(message='Could not find list of masters \
|
||||
in minion configuration but `via_master` was specified.')
|
||||
else:
|
||||
# Find the master in the list of master_uris generated by the minion base class
|
||||
matching_master_uris = [master for master
|
||||
in __opts__['master_uri_list']
|
||||
in __opts__['master_uri_list']
|
||||
if '//{0}:'.format(via_master)
|
||||
in master]
|
||||
|
||||
if not matching_master_uris:
|
||||
raise SaltInvocationError('''Could not find match for {0} in
|
||||
list of configured masters when using `via_master` option'''.format(
|
||||
raise SaltInvocationError('Could not find match for {0} in \
|
||||
list of configured masters {1} when using `via_master` option'.format(
|
||||
via_master, __opts__['master_uri_list']))
|
||||
|
||||
if len(matching_master_uris) > 1:
|
||||
# If we have multiple matches, consider this a non-fatal error
|
||||
# and continue with whatever we found first.
|
||||
log.warning('''The `via_master` flag found
|
||||
more than one possible match found for {0} when evaluating
|
||||
list {1}'''.format(via_master, __opts__['master_uri_list']))
|
||||
log.warning('The `via_master` flag found \
|
||||
more than one possible match found for {0} when evaluating \
|
||||
list {1}'.format(via_master, __opts__['master_uri_list']))
|
||||
master_uri = matching_master_uris.pop()
|
||||
else:
|
||||
# If no preference is expressed by the user, just publish to the first master
|
||||
|
|
Loading…
Add table
Reference in a new issue