~fginther/landscape-client/fix-missing-install-dirs

« back to all changes in this revision

Viewing changes to landscape/manager/customgraph.py

  • Committer: 🤖 Landscape Builder
  • Author(s): Steffen Allner
  • Date: 2017-04-05 15:59:20 UTC
  • mfrom: (997.2.3 py3-cleanup)
  • Revision ID: _landscape_builder-20170405155920-ffx0c6wpxo26i9xd
Merge py3-cleanup [f=] [r=ericsnowcurrently,landscape-builder,nilo] [a=Gocept]
Cleanups related to landscape.compat (and lint).

This MP cleans up small residues from the port to Python 2/3 compatibility. It removes the unwanted coerce_unicode() helper method, which was replaced by individual solutions at the respective place of use. Furthermore unused imports have been removed and the usage (c)StringIO has been investigated, whether it could be replaced by a common io.{String,Bytes}IO() call in Python 2 and 3. This was often not the case, as this was also connected with the logging setup in the tests, which should not be addressed here.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
from twisted.internet.defer import fail, DeferredList, succeed
6
6
from twisted.python.compat import iteritems
7
7
 
8
 
from landscape.compat import coerce_unicode
9
8
from landscape.lib.scriptcontent import generate_script_hash
10
9
from landscape.accumulate import Accumulator
11
10
from landscape.manager.plugin import ManagerPlugin
189
188
        if graph_id not in self._data:
190
189
            return
191
190
        if failure.check(ProcessFailedError):
192
 
            failure_value = coerce_unicode(failure.value.data, "utf-8")
 
191
            failure_value = failure.value.data
193
192
            if failure.value.exit_code:
194
193
                failure_value = ("%s (process exited with code %d)" %
195
194
                                 (failure_value, failure.value.exit_code))