Merge lp:~matthias-cramer/charms/precise/haproxy/appsession into lp:charms/haproxy

Proposed by Matthias Cramer
Status: Rejected
Rejected by: Tom Haddon
Proposed branch: lp:~matthias-cramer/charms/precise/haproxy/appsession
Merge into: lp:charms/haproxy
Diff against target: 81 lines (+30/-2) (has conflicts)
3 files modified
config.yaml (+4/-0)
hooks/hooks.py (+22/-2)
revision (+4/-0)
Text conflict in hooks/hooks.py
Text conflict in revision
To merge this branch: bzr merge lp:~matthias-cramer/charms/precise/haproxy/appsession
Reviewer Review Type Date Requested Status
Tom Haddon Needs Fixing
charmers Pending
Review via email: mp+148651@code.launchpad.net

Description of the change

Added possibility to add appsession parameter to the configfile

To post a comment you must log in.
Revision history for this message
Tom Haddon (mthaddon) wrote :

There seem to be two text conflicts in the merge proposal - can you take a look?

Also, I think this may be achievable within the existing charm just by appending "spip_session len 34 timeout 3h request-learn" to the "service_options" parameter. As an example, if you have this:

    services: |
              - service_name: haproxy_service
                service_host: "0.0.0.0"
                service_port: 80
                service_options: [option httpchk GET /, balance leastconn]
                server_options: check inter 2000 rise 2 fall 5 maxconn 32

You could simply change it to this:

    services: |
              - service_name: haproxy_service
                service_host: "0.0.0.0"
                service_port: 80
                service_options: [option httpchk GET /, balance leastconn, spip_session len 34 timeout 3h request-learn]
                server_options: check inter 2000 rise 2 fall 5 maxconn 32

Can you try that and see if it does what you're hoping to achieve?

review: Needs Fixing
Revision history for this message
Pierre Amadio (pierre-amadio) wrote :

I was able to deploy the vanilla haproxy charm with the following yaml file:

melmoth@x220:~/dev/spip-juju$ cat spip.yaml
haproxy:
     default_timeouts: "queue 7000, connect 7000, client 7000, server 7000"
     services: |
                - service_name: haproxy_service
                  service_host: "0.0.0.0"
                  service_port: 80
                  service_options: [balance leastconn , appsession spip_session len 34 timeout 3h request-learn]
                  server_options: maxconn 100
spip:
     spip-origin: 3.0.5

The haproxy.cfg configuration file ends up with the same content as what it would have been using the merge proposal and setting listen_appsession to 'spip_session len 34 timeout 3h request-learn'

Looks to me the merge request is not needed.

Revision history for this message
Tom Haddon (mthaddon) wrote :

> I was able to deploy the vanilla haproxy charm with the following yaml file:
>
> melmoth@x220:~/dev/spip-juju$ cat spip.yaml
> haproxy:
> default_timeouts: "queue 7000, connect 7000, client 7000, server 7000"
> services: |
> - service_name: haproxy_service
> service_host: "0.0.0.0"
> service_port: 80
> service_options: [balance leastconn , appsession
> spip_session len 34 timeout 3h request-learn]
> server_options: maxconn 100
> spip:
> spip-origin: 3.0.5
>
> The haproxy.cfg configuration file ends up with the same content as what it
> would have been using the merge proposal and setting listen_appsession to
> 'spip_session len 34 timeout 3h request-learn'
>
>
> Looks to me the merge request is not needed.

Marking as rejected per this comment

Unmerged revisions

65. By Matthias Cramer

added more description

64. By Matthias Cramer

Added config parameter listen_appsession to set appsession parameter

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2012-10-10 14:38:47 +0000
3+++ config.yaml 2013-02-15 10:30:34 +0000
4@@ -66,6 +66,10 @@
5 default: False
6 type: boolean
7 description: Enable monitoring
8+ listen_appsession:
9+ default: ""
10+ type: string
11+ description: appsession config e.g. 'spip_session len 34 timeout 3h request-learn'
12 monitoring_port:
13 default: 10000
14 type: int
15
16=== modified file 'hooks/hooks.py'
17--- hooks/hooks.py 2013-02-14 21:35:47 +0000
18+++ hooks/hooks.py 2013-02-15 10:30:34 +0000
19@@ -269,7 +269,7 @@
20 #------------------------------------------------------------------------------
21 def create_listen_stanza(service_name=None, service_ip=None,
22 service_port=None, service_options=None,
23- server_entries=None):
24+ server_entries=None, listen_appsession=None):
25 if service_name is None or service_ip is None or service_port is None:
26 return(None)
27 service_config = []
28@@ -278,6 +278,8 @@
29 if service_options is not None:
30 for service_option in service_options:
31 service_config.append(" %s" % service_option.strip())
32+ if listen_appsession is not None:
33+ service_config.append(" appsession %s" % listen_appsession.strip())
34 if server_entries is not None and isinstance(server_entries, list):
35 for (server_name, server_ip, server_port, server_options) \
36 in server_entries:
37@@ -449,7 +451,25 @@
38 #------------------------------------------------------------------------------
39 def create_services():
40 services_list = get_config_services()
41+<<<<<<< TREE
42 services_dict = get_services_dict()
43+=======
44+ services_dict = {}
45+ for service_item in services_list:
46+ service_name = service_item['service_name']
47+ service_host = service_item['service_host']
48+ service_port = service_item['service_port']
49+ service_options = service_item['service_options']
50+ server_options = service_item['server_options']
51+ services_dict[service_name] = {'service_name': service_name,
52+ 'service_host': service_host,
53+ 'service_port': service_port,
54+ 'service_options': service_options,
55+ 'server_options': server_options}
56+
57+ config_data = config_get()
58+ listen_appsession = yaml.load(config_data['listen_appsession'])
59+>>>>>>> MERGE-SOURCE
60
61 # service definitions overwrites user specified haproxy file in
62 # a pseudo-template form
63@@ -505,7 +525,7 @@
64 services_dict[service]['service_host'],
65 services_dict[service]['service_port'],
66 services_dict[service]['service_options'],
67- server_entries))
68+ server_entries,listen_appsession))
69
70
71 #------------------------------------------------------------------------------
72
73=== modified file 'revision'
74--- revision 2013-02-14 21:35:47 +0000
75+++ revision 2013-02-15 10:30:34 +0000
76@@ -1,1 +1,5 @@
77+<<<<<<< TREE
78 42
79+=======
80+32
81+>>>>>>> MERGE-SOURCE

Subscribers

People subscribed via source and target branches