In particular, avoid the use of operator, partial and map when they read more
like directly translated Haskell code than idiomatic python.

This patchset should have no significant functional changes. If it does, I got
something wrong.

Brian Foley (6):
  Replace map(operator.attrgetter, ...) uses
  Replace uses of map/lambda with more Pythonic code
  Replace map/partial with list comprehension.
  Sprinkle some more list comprehensions
  Avoid overuse of operator in watcher *.py
  Simplify some inscrutable map/map/ifilter/zip code

 lib/cli.py                               |  8 +++----
 lib/client/gnt_cluster.py                | 11 ++--------
 lib/cmdlib/cluster/__init__.py           |  6 ++++--
 lib/cmdlib/cluster/verify.py             | 30 ++++++++++++--------------
 lib/cmdlib/common.py                     | 11 ++++++----
 lib/cmdlib/instance_query.py             | 14 ++++++------
 lib/cmdlib/instance_storage.py           |  2 +-
 lib/config/__init__.py                   |  7 +++---
 lib/hypervisor/hv_xen.py                 |  4 ++--
 lib/jqueue/__init__.py                   |  4 ++--
 lib/luxi.py                              |  4 ++--
 lib/mcpu.py                              |  6 ++----
 lib/qlang.py                             |  7 +++---
 lib/query.py                             | 15 +++++++------
 lib/rpc/node.py                          | 11 +++++-----
 lib/storage/bdev.py                      |  6 +++---
 lib/storage/filestorage.py               |  4 ++--
 lib/tools/node_cleanup.py                |  6 +++---
 lib/watcher/__init__.py                  | 34 ++++++++++++++---------------
 qa/qa_instance_utils.py                  |  5 +----
 qa/qa_rapi.py                            |  4 +---
 test/py/cmdlib/cluster_unittest.py       |  7 +++---
 test/py/cmdlib/instance_unittest.py      | 37 +++++++++++++++-----------------
 test/py/docs_unittest.py                 |  4 +---
 test/py/ganeti.cli_unittest.py           |  2 +-
 test/py/ganeti.config_unittest.py        |  5 ++---
 test/py/ganeti.jqueue_unittest.py        | 17 +++++++--------
 test/py/ganeti.rpc_unittest.py           |  5 +++--
 test/py/ganeti.utils.hash_unittest.py    |  1 -
 test/py/ganeti.utils.storage_unittest.py |  5 ++---
 test/py/ganeti.utils_unittest.py         |  1 -
 test/py/qa.qa_config_unittest.py         | 12 ++++-------
 test/py/testutils/config_mock.py         |  2 +-
 33 files changed, 135 insertions(+), 162 deletions(-)

-- 
2.8.0.rc3.226.g39d4020

Reply via email to