DescriptionRefactor for easier builtin server integration.
Refactor the charm code to ease integration of the builtin server.
Detail of the changes, per file:
hooks/backend.py:
- order the mixins code as they are called, to ease readability;
- merge InstallMixin into GuiMixin;
- rename UpstartMixin to HaproxyApacheMixin;
- reimplement GuiMixin.install using the new functions from the split of
hooks/utils.py#fetch_gui (see below);
- reimplement GuiMixin.start using the new functions from the split of
hooks/utils.py#start_gui (see below);
- move here the chain and merge functions from hooks/utils.py, renaming
them to be less generic;
- further simplify the backend constructor code.
hooks/utils.py:
- rename JUJU_GUI_SITE and JUJU_GUI_PORTS to APACHE_SITE and
APACHE_PORTS respectively;
- split the start_gui function into compute_build_dir, write_gui_config
and write_haproxy_config;
- split the fetch_gui function into fetch_gui_from_branch and
fetch_gui_release;
- move the chain and merge functions to hooks/backend.py.
tests/test_backends.py:
- rename, add mocks and reorder to make tests pass again.
tests/test_utils.py:
- rename TestStartStop to TestStartImprovAgentGui;
- split the start_gui function tests in TestStartImprovAgentGui into
tests for compute_build_dir, write_gui_config, write_haproxy_config
and write_apache_config;
Sorry for the big diff. It was even bigger, but I moved some of the
changes to a future branch.
https://code.launchpad.net/~teknico/charms/precise/juju-gui/refactor-gui-startup/+merge/177364
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 11
Patch Set 2 : Refactor for easier builtin server integration. #Patch Set 3 : Refactor for easier builtin server integration. #
MessagesTotal messages: 7
|