diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2016-08-09 20:50:30 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2018-10-18 16:19:13 +0200 |
commit | cdc6ebb3ffb28e3ea5dd645fe63054d454210dd5 (patch) | |
tree | e98337ed414849e9d422c5aa2ca67b5d3dc39f87 /src/lib/Bcfg2/Server/Plugins/Packages/Pkgng.py | |
parent | 1a34131f036eec99334def218229bcca6512083e (diff) | |
download | bcfg2-cdc6ebb3ffb28e3ea5dd645fe63054d454210dd5.tar.gz bcfg2-cdc6ebb3ffb28e3ea5dd645fe63054d454210dd5.tar.bz2 bcfg2-cdc6ebb3ffb28e3ea5dd645fe63054d454210dd5.zip |
Plugins/Packages/Pkgng: Ignore unicode errors
The messages of the packages in the packagesite file may be encoded in
any encoding. We only need the dependencies and just ignore the unicode
errors.
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Pkgng.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Packages/Pkgng.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Pkgng.py b/src/lib/Bcfg2/Server/Plugins/Packages/Pkgng.py index 4938efb94..55dd4e488 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Pkgng.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Pkgng.py @@ -76,9 +76,7 @@ class PkgngSource(Source): self.logger.error("Packages: Failed to read file %s" % fname) raise for line in reader.readlines(): - if not isinstance(line, str): - line = line.decode('utf-8') - pkg = json.loads(line) + pkg = json.loads(unicode(line, errors='ignore')) pkgname = pkg['name'] self.pkgnames.add(pkgname) if 'deps' in pkg: |