mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Remove obsolete unicode handling in pkg.info_installed
This commit is contained in:
parent
93dab45307
commit
99079fc442
1 changed files with 0 additions and 9 deletions
|
@ -482,15 +482,6 @@ def info_installed(*names, **kwargs):
|
|||
t_nfo = dict()
|
||||
# Translate dpkg-specific keys to a common structure
|
||||
for key, value in six.iteritems(pkg_nfo):
|
||||
if isinstance(value, six.string_types):
|
||||
# Check, if string is encoded in a proper UTF-8
|
||||
if six.PY3:
|
||||
value_ = value.encode('UTF-8', 'ignore').decode('UTF-8', 'ignore')
|
||||
else:
|
||||
value_ = value.decode('UTF-8', 'ignore').encode('UTF-8', 'ignore')
|
||||
if value != value_:
|
||||
value = kwargs.get('errors', 'ignore') == 'ignore' and value_ or 'N/A (invalid UTF-8)'
|
||||
log.error('Package %s has bad UTF-8 code in %s: %s', pkg_name, key, value)
|
||||
if key == 'source_rpm':
|
||||
t_nfo['source'] = value
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue