mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Change 'errors' flag to boolean.
This commit is contained in:
parent
e425cbd654
commit
a7d3e0d5ad
1 changed files with 1 additions and 1 deletions
|
@ -137,7 +137,7 @@ def info_installed(*names, **kwargs):
|
|||
for key, value in pkg_nfo.items():
|
||||
if type(value) == str:
|
||||
# Check, if string is encoded in a proper UTF-8
|
||||
value_ = value.decode('UTF-8', 'ignore').encode('UTF-8', 'ignore')
|
||||
value = kwargs.get('errors') and 'N/A (bad UTF-8)' or value_
|
||||
if value != value_:
|
||||
value = kwargs.get('errors', 'ignore') == 'ignore' and value_ or 'N/A (invalid UTF-8)'
|
||||
log.error('Package {0} has bad UTF-8 code in {1}: {2}'.format(pkg_name, key, value))
|
||||
|
|
Loading…
Add table
Reference in a new issue