Merge lp:~hloeung/ubuntu-repository-cache/missing-apache2-cgi-mod into lp:ubuntu-repository-cache

Proposed by Haw Loeung
Status: Merged
Approved by: Haw Loeung
Approved revision: 314
Merged at revision: 313
Proposed branch: lp:~hloeung/ubuntu-repository-cache/missing-apache2-cgi-mod
Merge into: lp:ubuntu-repository-cache
Diff against target: 44 lines (+9/-3)
2 files modified
lib/ubuntu_repository_cache/apache.py (+7/-1)
tests/unit/test_apache.py (+2/-2)
To merge this branch: bzr merge lp:~hloeung/ubuntu-repository-cache/missing-apache2-cgi-mod
Reviewer Review Type Date Requested Status
Paul Collins lgtm Approve
Canonical IS Reviewers Pending
Review via email: mp+398421@code.launchpad.net

Commit message

Enable cgi module on install otherwise health check succeeds with output from the script; also we want cgid for multi-threaded apache2

To post a comment you must log in.
313. By Haw Loeung

Enable cgi module on install otherwise health check succeeds with output from the script; also we want cgid for multi-threaded apache2

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

314. By Haw Loeung

Ensure apache reloaded/started after enabling various modules in install()

Revision history for this message
Paul Collins (pjdc) :
review: Approve (lgtm)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 313

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/ubuntu_repository_cache/apache.py'
2--- lib/ubuntu_repository_cache/apache.py 2021-02-19 09:11:59 +0000
3+++ lib/ubuntu_repository_cache/apache.py 2021-02-22 03:11:35 +0000
4@@ -38,6 +38,12 @@
5 subprocess.check_call(['a2enmod', 'mpm_worker'])
6 subprocess.check_call(['a2dissite', '000-default'])
7
8+ config = hookenv.config()
9+ if config['enable_healthcheck']:
10+ subprocess.check_call(['a2enmod', 'cgid'])
11+
12+ start()
13+
14
15 @util.run_as_user('root')
16 def start(start_only=False):
17@@ -223,7 +229,7 @@
18 cmd = 'a2dismod'
19 action = 'Disabled'
20
21- subprocess.check_call([cmd, 'cgi'])
22+ subprocess.check_call([cmd, 'cgid'])
23 LOG('{} health check endpoint'.format(action))
24 restart_required = True
25
26
27=== modified file 'tests/unit/test_apache.py'
28--- tests/unit/test_apache.py 2021-02-19 09:11:59 +0000
29+++ tests/unit/test_apache.py 2021-02-22 03:11:35 +0000
30@@ -66,12 +66,12 @@
31 def test_configure_health_check(self, check_call, call, seteuid, setegid, chown, write_file):
32 config = hookenv.Config({'enable_healthcheck': True})
33 self.assertEqual(apache.configure_health_check(config), True)
34- check_call.assert_called_with(['a2enmod', 'cgi'])
35+ check_call.assert_called_with(['a2enmod', 'cgid'])
36
37 check_call.reset_mock()
38 config = hookenv.Config({'enable_healthcheck': False})
39 self.assertEqual(apache.configure_health_check(config), True)
40- check_call.assert_called_with(['a2dismod', 'cgi'])
41+ check_call.assert_called_with(['a2dismod', 'cgid'])
42
43 check_call.reset_mock()
44 config = hookenv.Config({'enable_healthcheck': True})

Subscribers

People subscribed via source and target branches