mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Under Python 2.6, curly braces in strings to .format()
MUST be indexed.
This commit is contained in:
parent
a949e94aca
commit
db02bfdfa2
@ -58,7 +58,7 @@ if salt.utils.is_windows():
|
||||
# The following imports are used by the namespaced win_pkg funcs
|
||||
# and need to be included in their globals.
|
||||
import msgpack
|
||||
from distutils.version import LooseVersion # pylint: disable=E0611
|
||||
from distutils.version import LooseVersion # pylint: disable=E0611,F0401
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -647,7 +647,8 @@ def latest(
|
||||
comment += ' The following packages are already ' \
|
||||
'up-to-date: {0}.'.format(', '.join(sorted(up_to_date)))
|
||||
else:
|
||||
comment += ' {} packages are already up-to-date.'.format(len(up_to_date))
|
||||
comment += ' {0} packages are already up-to-date.'.format(
|
||||
len(up_to_date))
|
||||
|
||||
return {'name': name,
|
||||
'changes': {},
|
||||
@ -687,7 +688,8 @@ def latest(
|
||||
msg = 'The following packages were already up-to-date: ' \
|
||||
'{0}.'.format(', '.join(sorted(up_to_date)))
|
||||
else:
|
||||
msg = '{} packages were already up-to-date. '.format(len(up_to_date))
|
||||
msg = '{0} packages were already up-to-date. '.format(
|
||||
len(up_to_date))
|
||||
comments.append(msg)
|
||||
|
||||
return {'name': name,
|
||||
@ -696,7 +698,7 @@ def latest(
|
||||
'comment': ' '.join(comments)}
|
||||
else:
|
||||
if len(targets) > 10:
|
||||
comment = 'All targeted {} packages failed to update.'\
|
||||
comment = 'All targeted {0} packages failed to update.'\
|
||||
.format(len(targets))
|
||||
elif len(targets) > 1:
|
||||
comment = 'All targeted packages failed to update: ' \
|
||||
@ -710,7 +712,7 @@ def latest(
|
||||
'up-to-date: ' \
|
||||
'{0}'.format(', '.join(sorted(up_to_date)))
|
||||
else:
|
||||
comment += '{} packages were already ' \
|
||||
comment += '{0} packages were already ' \
|
||||
'up-to-date.'.format(len(up_to_date))
|
||||
|
||||
return {'name': name,
|
||||
@ -719,7 +721,8 @@ def latest(
|
||||
'comment': comment}
|
||||
else:
|
||||
if len(desired_pkgs) > 10:
|
||||
comment = 'All {} packages are up-to-date.'.format(len(desired_pkgs))
|
||||
comment = 'All {0} packages are up-to-date.'.format(
|
||||
len(desired_pkgs))
|
||||
elif len(desired_pkgs) > 1:
|
||||
comment = 'All packages are up-to-date ' \
|
||||
'({0}).'.format(', '.join(sorted(desired_pkgs)))
|
||||
|
Loading…
Reference in New Issue
Block a user