From 1d384b6abdd319afee650ceeba2e81404794835f Mon Sep 17 00:00:00 2001 From: Bo Maryniuk Date: Tue, 19 Jan 2016 13:02:46 +0100 Subject: [PATCH] Add error handling to the RPM broken strings --- salt/modules/zypper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py index d2cad9934c..21e5c3a8d7 100644 --- a/salt/modules/zypper.py +++ b/salt/modules/zypper.py @@ -129,7 +129,7 @@ def info_installed(*names, **kwargs): # Check, if string is encoded in a proper UTF-8 value_ = value.decode('UTF-8', 'ignore').encode('UTF-8', 'ignore') if value != value_: - value = value_ + value = kwargs.get('errors', 'ignore') == 'ignore' and value_ or 'N/A (broken)' log.error('Package {0} has bad UTF-8 code in {1}: {2}'.format(pkg_name, key, value)) if key == 'source_rpm': t_nfo['source'] = value