Merge lp:~jamestait/rnr-server/sca-conn-check-301 into lp:rnr-server

Proposed by James Tait
Status: Merged
Approved by: Wes Mason
Approved revision: 323
Merged at revision: 322
Proposed branch: lp:~jamestait/rnr-server/sca-conn-check-301
Merge into: lp:rnr-server
Diff against target: 50 lines (+9/-2)
1 file modified
scripts/settings-to-conncheck.py (+9/-2)
To merge this branch: bzr merge lp:~jamestait/rnr-server/sca-conn-check-301
Reviewer Review Type Date Requested Status
Wes Mason (community) Approve
Daniel Manrique (community) Approve
Review via email: mp+297935@code.launchpad.net

Commit message

Update the conn-check settings generator to expect an HTTP 301 from SCA rather than a 302.

Description of the change

Update the conn-check settings generator to expect an HTTP 301 from SCA rather than a 302.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

You're changing a 302 (found, nothing else changes) to a 301 (redirect). I guess the question is, which URL will conn-check look for? if it's happy with the wanted URL giving a 301, regardless of the Location: header and won't do anything crazy like following the redirect until it gets a more definitive code, then this is fine. If, OTOH, conn-check follows the redirect, then I suspect the URL would need updating to the target one.

So this looks OK in principle, just need to clarify this bit.

Revision history for this message
Daniel Manrique (roadmr) wrote :

Never mind, per https://conn-check.readthedocs.io/en/latest/readme.html#http and as pointed out by Wes, it'll be happy as long as it gets the 301.

+1 then!

review: Approve
323. By James Tait

Instead of checking for the 301 redirect code, allow redirects for SCA and check for a 200. Also use a HEAD request instead of a GET.

Revision history for this message
Wes Mason (wesmason) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/settings-to-conncheck.py'
2--- scripts/settings-to-conncheck.py 2015-10-23 14:52:52 +0000
3+++ scripts/settings-to-conncheck.py 2016-06-20 17:11:49 +0000
4@@ -2,9 +2,11 @@
5
6 from conn_check_configs.django import * # noqa
7
8+
9 STATSD_CHECK['send'] = 'Hakuna'
10 STATSD_CHECK['expect'] = 'Matata'
11
12+
13 def make_http_checks(settings, options):
14 checks = []
15 urls = (
16@@ -13,18 +15,21 @@
17 '',
18 200,
19 'HEAD',
20+ False,
21 ),
22 (
23 settings['CLICK_INDEX_API_URI'],
24 '/search',
25 200,
26 'HEAD',
27+ False,
28 ),
29 (
30 settings['SCA_HOST_URL'],
31 '',
32- 302,
33- 'GET',
34+ 200,
35+ 'HEAD',
36+ True,
37 ),
38 )
39
40@@ -37,10 +42,12 @@
41 'url': '{0}{1}'.format(url[0], url[1]),
42 'method': url[3],
43 'expected_code': url[2],
44+ 'allow_redirects': url[4],
45 })
46
47 return checks
48
49+
50 EXTRA_CHECK_MAKERS.append(make_http_checks)
51
52

Subscribers

People subscribed via source and target branches

to all changes: