Lint error in publish

This commit is contained in:
Mike Place 2016-10-19 16:45:08 +09:00
parent e22a3d2be6
commit 9bbe3c998b
No known key found for this signature in database
GPG key ID: 9136F4F13705CFD3

View file

@ -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