[Kimchi-devel] [PATCH 00/16] Reorganize controller module

Aline Manera alinefm at linux.vnet.ibm.com
Mon Dec 23 18:41:15 UTC 2013


From: Aline Manera <alinefm at br.ibm.com>

The current implemenation put all resources implementation into controller.py 
file. That way this file tends to increase to infinity as more resources are 
added to Kimchi.

This patch splits controller module (controller.py) into small modules.
So each resource will have its own controller implementation under /control
It will make maintenance easier and anyone can easily identify where any resource
is implemented.

This patch set does not change any logic - just move classes from controller
to a new module.

Aline Manera (16):
  Move generate_action_handler() function to Resource() class
  Move common functions for Resource and Collection to control/utils.py
  Move login() and logout() functions from controller.py to root.py
  Move basic controller resources to control/base.py
  Move all resources related to vms to control/vms.py
  Move all resources related to templates to control/templates.py
  Move all resources related to debug reports to
    control/debugreports.py
  Move all resources related to storage pools to
    control/storagepools.py
  Move all resources related to storage volume to
    control/storagevolumes.py
  Move all resources related to interfaces to control/interfaces.py
  Move all resources related to networks to control/networks.py
  Move all resources related to config to control/config.py
  Move all resources related to host to control/host.py
  Move all resources related to plugins to control/plugins.py
  Move all resources related to tasks to control/tasks.py
  Use new control modules in root.py

 Makefile.am                          |   13 +
 src/kimchi/control/__init__.py       |   21 +
 src/kimchi/control/base.py           |  290 +++++++++++++
 src/kimchi/control/config.py         |   65 +++
 src/kimchi/control/debugreports.py   |   52 +++
 src/kimchi/control/host.py           |   61 +++
 src/kimchi/control/interfaces.py     |   44 ++
 src/kimchi/control/networks.py       |   48 +++
 src/kimchi/control/plugins.py        |   44 ++
 src/kimchi/control/storagepools.py   |  125 ++++++
 src/kimchi/control/storagevolumes.py |   79 ++++
 src/kimchi/control/tasks.py          |   41 ++
 src/kimchi/control/templates.py      |   51 +++
 src/kimchi/control/utils.py          |  103 +++++
 src/kimchi/control/vms.py            |   64 +++
 src/kimchi/controller.py             |  755 ----------------------------------
 src/kimchi/root.py                   |   61 ++-
 17 files changed, 1147 insertions(+), 770 deletions(-)
 create mode 100644 src/kimchi/control/__init__.py
 create mode 100644 src/kimchi/control/base.py
 create mode 100644 src/kimchi/control/config.py
 create mode 100644 src/kimchi/control/debugreports.py
 create mode 100644 src/kimchi/control/host.py
 create mode 100644 src/kimchi/control/interfaces.py
 create mode 100644 src/kimchi/control/networks.py
 create mode 100644 src/kimchi/control/plugins.py
 create mode 100644 src/kimchi/control/storagepools.py
 create mode 100644 src/kimchi/control/storagevolumes.py
 create mode 100644 src/kimchi/control/tasks.py
 create mode 100644 src/kimchi/control/templates.py
 create mode 100644 src/kimchi/control/utils.py
 create mode 100644 src/kimchi/control/vms.py
 delete mode 100644 src/kimchi/controller.py

-- 
1.7.10.4




More information about the Kimchi-devel mailing list