This patch series makes a first attempt at converting lots of boilerplate code in lib/rpc.py to a definition-based model. A definition file (lib/build/rpc_definitions.py) is converted to Python code at build time by autotools/build-rpc. The resulting class(es) are then used as base classes in lib/rpc.py.
Not all calls have been converted yet. Some need more work for special cases (e.g. support for name resolution via ssconf). The number of lines in rpc.py has been cut in half. Michael Hanselmann (18): Fix parameters to RPC "os_validate" Fix parameters to RPC "blockdev_rename" Add script to generate RPC wrappers rpc: Disable timeout check rpc_definitions: Add helpers Add RPC definitions rpc: Add support for generated RPC wrappers rpc: Add helpers rpc: Convert import/export functions rpc: Convert X509 calls rpc: Convert OS-related calls rpc: Convert node-related calls rpc: Convert file-storage-related calls rpc: Convert misc calls rpc: Convert instance-related calls rpc: Convert blockdev-related calls rpc: Convert storage-related calls rpc: Convert wrappers for starting import/export daemons .gitignore | 1 + Makefile.am | 10 +- autotools/build-rpc | 204 +++++++++ lib/build/rpc_definitions.py | 350 +++++++++++++++ lib/cmdlib.py | 2 +- lib/rpc.py | 1022 +++++------------------------------------- lib/server/noded.py | 2 +- test/ganeti.rpc_unittest.py | 13 +- 8 files changed, 685 insertions(+), 919 deletions(-) create mode 100755 autotools/build-rpc create mode 100644 lib/build/rpc_definitions.py -- 1.7.6
