SHA256
1
0
forked from pool/salt
salt/remove-obsolete-unicode-handling-in-pkg.info_install.patch

43 lines
1.8 KiB
Diff
Raw Normal View History

From 79a840d183975d949d4c4cadf392e0f37dea16a9 Mon Sep 17 00:00:00 2001
Accepting request 581002 from systemsmanagement:saltstack:testing - Remove salt-minion python2 requirement when python3 is default (bsc#1081592) - Remove-obsolete-unicode-handling-in-pkg.info_installed - Added: * remove-obsolete-unicode-handling-in-pkg.info_install.patch - Update to salt-2018.1.99 - Modified: * activate-all-beacons-sources-config-pillar-grains.patch * avoid-excessive-syslogging-by-watchdog-cronjob-58.patch * feat-add-grain-for-all-fqdns.patch * fix-bsc-1065792.patch * list_pkgs-add-parameter-for-returned-attribute-selec.patch * run-salt-api-as-user-salt-bsc-1064520.patch * run-salt-master-as-dedicated-salt-user.patch - Deleted: * python3-compatibility-fix-got-bytes-instead-of-strin.patch * enable-with-salt-version-parameter-for-setup.py-scri.patch * catching-error-when-pidfile-cannot-be-deleted.patch * bugfix-always-return-a-string-list-on-unknown-job-ta.patch * bugfix-the-logic-according-to-the-exact-described-pu.patch * cherrypy-read-reads-bytes-from-the-wire-and-write-th.patch * fix-for-delete_deployment-in-kubernetes-module.patch * fix-salt-master-for-old-psutil.patch * introduce-process_count_max-minion-configuration-par.patch * multiprocessing-minion-option-documentation-fixes.patch * older-logrotate-need-su-directive.patch * return-error-when-gid_from_name-and-group-does-not-e.patch * set-shell-environment-variable-64.patch * split-only-strings-if-they-are-such.patch OBS-URL: https://build.opensuse.org/request/show/581002 OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:saltstack/salt?expand=0&rev=112
2018-02-28 16:27:22 +01:00
From: Mihai Dinca <mdinca@suse.de>
Date: Tue, 13 Feb 2018 16:11:20 +0100
Subject: [PATCH] Remove obsolete unicode handling in pkg.info_installed
---
salt/modules/zypper.py | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py
index 51d01c3fc9..659d8858f0 100644
--- a/salt/modules/zypper.py
+++ b/salt/modules/zypper.py
@@ -309,7 +309,7 @@ class _Zypper(object):
if self.error_msg and not self.__no_raise and not self.__ignore_repo_failure:
raise CommandExecutionError('Zypper command failure: {0}'.format(self.error_msg))
- return self._is_xml_mode() and dom.parseString(self.__call_result['stdout']) or self.__call_result['stdout']
+ return self._is_xml_mode() and dom.parseString(self.__call_result['stdout'].encode('utf-8')) or self.__call_result['stdout']
__zypper__ = _Zypper()
@@ -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:
--
2.16.1