Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1275)

Issue 12467044: Refactor the config generation logic.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by teknico
Modified:
10 years, 8 months ago
Reviewers:
bac, frankban, mp+178594
Visibility:
Public.

Description

Refactor the config generation logic. As requested by reviews, change the server configuration generation logic so that the various server configuration files are present on the filesystem only for the actually deployed and started servers. This is implemented by creating additional start_* and stop_* functions in hooks/utils.py, called by the mixins in hooks/backend.py, and moving there/creating the logic that generates, writes and remove the various configuration files. In addition: - factor out common SSL code between HaproxyApacheMixin and BuiltinServerMixin; - rename options.http to options.insecure in server/guiserver/manage.py - remove unused code and backend properties; - miscellaneous cleanup. The diff is still a bit big, even after moving the builtin server integration changes to another branch. Sorry about that. https://code.launchpad.net/~teknico/charms/precise/juju-gui/refactor-config-generation-logic/+merge/178594 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 12

Patch Set 2 : Refactor the config generation logic. #

Patch Set 3 : Refactor the config generation logic. #

Total comments: 1

Patch Set 4 : Refactor the config generation logic. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+300 lines, -226 lines) Patch
M Makefile View 1 1 chunk +1 line, -1 line 0 comments Download
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M config.yaml View 2 chunks +4 lines, -5 lines 0 comments Download
M hooks/backend.py View 11 chunks +49 lines, -47 lines 0 comments Download
M hooks/install View 1 chunk +1 line, -3 lines 0 comments Download
M hooks/utils.py View 1 2 3 17 chunks +115 lines, -66 lines 0 comments Download
M revision View 1 chunk +1 line, -1 line 0 comments Download
M server/guiserver/manage.py View 2 chunks +6 lines, -7 lines 0 comments Download
M server/guiserver/tests/test_manage.py View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M server/runserver.py View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M tests/20-functional.test View 1 chunk +0 lines, -1 line 0 comments Download
M tests/test_backends.py View 9 chunks +36 lines, -64 lines 0 comments Download
M tests/test_utils.py View 1 2 9 chunks +76 lines, -27 lines 0 comments Download

Messages

Total messages: 12
teknico
Please take a look.
10 years, 9 months ago (2013-08-05 15:53:03 UTC) #1
frankban
Thank you Nicola for this branch: the charm is looking clearer now IMHO. LGTM with ...
10 years, 9 months ago (2013-08-06 12:57:23 UTC) #2
frankban
Unfortunately I found an error in QA. This branch cannot be landed until this error ...
10 years, 9 months ago (2013-08-06 13:57:36 UTC) #3
teknico
Please take a look.
10 years, 9 months ago (2013-08-06 14:20:12 UTC) #4
teknico
frankban wrote: > https://codereview.appspot.com/12467044/diff/1/hooks/utils.py#newcode113 > hooks/utils.py:113: HAPROXY_PATH = '/etc/haproxy/haproxy.cfg' > Minor: add those new consts ...
10 years, 9 months ago (2013-08-06 14:44:00 UTC) #5
teknico
> https://codereview.appspot.com/12467044/diff/1/tests/20-functional.test#newcode207 >> tests/20-functional.test:207: def test_force_machine(self): >> IIRC, you mentioned that this test no longer ...
10 years, 9 months ago (2013-08-06 15:24:06 UTC) #6
bac
LGTM: Code looks good and QA was fine. https://codereview.appspot.com/12467044/diff/1/hooks/utils.py File hooks/utils.py (right): https://codereview.appspot.com/12467044/diff/1/hooks/utils.py#newcode137 hooks/utils.py:137: """, ...
10 years, 9 months ago (2013-08-06 15:50:54 UTC) #7
teknico
bac wrote: > LGTM: Code looks good and QA was fine. Great, thanks. > https://codereview.appspot.com/12467044/diff/1/hooks/utils.py#newcode137 ...
10 years, 9 months ago (2013-08-06 15:52:53 UTC) #8
teknico
Please take a look.
10 years, 8 months ago (2013-08-07 13:15:51 UTC) #9
bac
LGTM with one question https://codereview.appspot.com/12467044/diff/7002/hooks/utils.py File hooks/utils.py (right): https://codereview.appspot.com/12467044/diff/7002/hooks/utils.py#newcode486 hooks/utils.py:486: cmd_log(run('ln', '-s', APACHE_SITE, APACHE_ENABLED)) Isn't ...
10 years, 8 months ago (2013-08-07 13:24:12 UTC) #10
teknico
bac wrote: > https://codereview.appspot.com/12467044/diff/7002/hooks/utils.py#newcode486 > hooks/utils.py:486: cmd_log(run('ln', '-s', APACHE_SITE, APACHE_ENABLED)) > Isn't this what the ...
10 years, 8 months ago (2013-08-07 13:43:39 UTC) #11
teknico
10 years, 8 months ago (2013-08-08 09:17:31 UTC) #12
*** Submitted:

Refactor the config generation logic.

As requested by reviews, change the server configuration generation logic
so that the various server configuration files are present on the
filesystem only for the actually deployed and started servers.

This is implemented by creating additional start_* and stop_* functions
in hooks/utils.py, called by the mixins in hooks/backend.py, and moving
there/creating the logic that generates, writes and remove the various
configuration files.

In addition:

- factor out common SSL code between HaproxyApacheMixin and
  BuiltinServerMixin;
- rename options.http to options.insecure in server/guiserver/manage.py
- remove unused code and backend properties;
- miscellaneous cleanup.

The diff is still a bit big, even after moving the builtin server
integration changes to another branch. Sorry about that.

R=frankban, bac
CC=
https://codereview.appspot.com/12467044
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b