Merge lp:~wgrant/launchpad/gpgservice-api-url into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 17968
Proposed branch: lp:~wgrant/launchpad/gpgservice-api-url
Merge into: lp:launchpad
Diff against target: 52 lines (+6/-5)
4 files modified
lib/lp/services/config/schema-lazr.conf (+2/-2)
lib/lp/services/gpg/handler.py (+1/-1)
lib/lp/testing/gpgservice/_fixture.py (+1/-1)
lib/lp/testing/gpgservice/tests/test_fixture.py (+2/-1)
To merge this branch: bzr merge lp:~wgrant/launchpad/gpgservice-api-url
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+290391@code.launchpad.net

Commit message

Turn gpgservice.api_endpoint into a full URL like the other *_endpoints.

Description of the change

Turn gpgservice.api_endpoint into a full URL like the other *_endpoints.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/services/config/schema-lazr.conf'
2--- lib/lp/services/config/schema-lazr.conf 2016-02-16 03:12:53 +0000
3+++ lib/lp/services/config/schema-lazr.conf 2016-03-30 03:54:07 +0000
4@@ -782,9 +782,9 @@
5 maps_api_key:
6
7 [gpgservice]
8-# The ip_address:port we can contact the gpgservice http api.
9+# The URL of the gpgservice API endpoint.
10 # datatype: string
11-api_endpoint:
12+api_endpoint: http://gpgservice.invalid/
13
14 [gpghandler]
15 # Should we allow uploading keys to the keyserver?
16
17=== modified file 'lib/lp/services/gpg/handler.py'
18--- lib/lp/services/gpg/handler.py 2016-03-23 17:55:39 +0000
19+++ lib/lp/services/gpg/handler.py 2016-03-30 03:54:07 +0000
20@@ -640,7 +640,7 @@
21 """See IGPGClient."""
22
23 def get_endpoint(self):
24- return "http://{}".format(config.gpgservice.api_endpoint)
25+ return config.gpgservice.api_endpoint
26
27 def get_timeout(self):
28 return 30.0
29
30=== modified file 'lib/lp/testing/gpgservice/_fixture.py'
31--- lib/lp/testing/gpgservice/_fixture.py 2016-03-21 05:37:40 +0000
32+++ lib/lp/testing/gpgservice/_fixture.py 2016-03-30 03:54:07 +0000
33@@ -67,7 +67,7 @@
34 if self._config_fixture is not None:
35 config_section = service_config = dedent("""\
36 [gpgservice]
37- api_endpoint: %s
38+ api_endpoint: http://%s/
39 """ % self.bind_address)
40 self._config_fixture.add_section(config_section)
41 config.reloadConfig()
42
43=== modified file 'lib/lp/testing/gpgservice/tests/test_fixture.py'
44--- lib/lp/testing/gpgservice/tests/test_fixture.py 2016-03-21 05:37:40 +0000
45+++ lib/lp/testing/gpgservice/tests/test_fixture.py 2016-03-30 03:54:07 +0000
46@@ -65,4 +65,5 @@
47 gpg_fixture = self.useFixture(GPGKeyServiceFixture(config_fixture))
48
49 self.assertEqual(
50- gpg_fixture.bind_address, config.gpgservice.api_endpoint)
51+ 'http://%s/' % gpg_fixture.bind_address,
52+ config.gpgservice.api_endpoint)