Merge lp:~jpds/launchpad/fix_517020 into lp:launchpad
- fix_517020
- Merge into devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Michael Nelson | ||||
Approved revision: | not available | ||||
Merged at revision: | 10283 | ||||
Proposed branch: | lp:~jpds/launchpad/fix_517020 | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
247 lines (+113/-20) 3 files modified
lib/lp/registry/interfaces/distributionmirror.py (+22/-16) lib/lp/registry/stories/webservice/xx-distribution-mirror.txt (+88/-3) lib/lp/registry/stories/webservice/xx-distribution.txt (+3/-1) |
||||
To merge this branch: | bzr merge lp:~jpds/launchpad/fix_517020 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brad Crittenden (community) | code | Approve | |
Michael Nelson (community) | code | Approve | |
Review via email: mp+18608@code.launchpad.net |
Commit message
Various fixes to exported() values in the newly exposed distribution_
Description of the change
Jonathan Davies (jpds) wrote : | # |
Michael Nelson (michael.nelson) wrote : | # |
Hi Jonathan,
It's great that you're so quick to get in there and fix his. Other than some formatting issues, the only point that I think needs addressing here is testing the writable of the fields you're changing/exporting.
> === modified file 'lib/lp/
> --- a/lib/lp/
> +++ b/lib/lp/
> @@ -287,17 +287,19 @@
>
> id = Int(title=_('The unique id'), required=True, readonly=True)
> owner = exported(
> - title=_('Owner'), required=False, readonly=True,
> - vocabulary=
> - reviewer = PublicPersonChoice(
> - title=_
> - vocabulary=
> + title=_('Owner'), description=_("The person who is set as the "
> + "current administrator of this mirror."), required=True,
> + readonly=False, vocabulary=
So the owner attribute is no-longer readonly? If that's intentional, we really
should have that tested/documented (ie. who can/can't write to it).
Also, just a few small indentation things looking at
the style guide. It might be easier to format this like:
title=
"The person who is set as the current administrator of this mirror."),
required=True, readonly=False, vocabulary=
or
title=
description=_(
"The person who is set as the current administrator of this mirror."))
> + reviewer = exported(
> + title=_
> + "mirror."), required=False, readonly=True,
> + vocabulary=
So the main change is that readonly is now true. Please ensure this is tested
also.
Similar formatting issues here. Although, I can't see anything in the
style-guide, but I thought that concatenated strings needed to be aligned (if
you have to break them).
> distribution = exported(
> Reference(
> Interface,
> # Really IDistribution, circular import fixed in
> # _schema_
> - title=_
> + title=_
Again, this needs to be tested (so it doesn't happen again).
> description=_("The distribution that is mirrored")))
> name = exported(
> title=_('Name'), required=True, readonly=False,
> @@ -325,7 +327,7 @@
> description=
> enabled = exported(Bool(
> title=_('This mirror was probed successfully.'),
> - required=False, readonly=False, default=False))
> + required=False, readonly=True, default=False))
And here too.
> speed = exported(Choice(
> title=_('Link Speed'), required=True, readonly=False,
> vocabulary=
> @@ -343,7 +345,8 @@
> title=_('Apply to...
Jonathan Davies (jpds) wrote : | # |
> === modified file 'lib/lp/
> > --- a/lib/lp/
> > +++ b/lib/lp/
> > @@ -287,17 +287,19 @@
> >
> > id = Int(title=_('The unique id'), required=True, readonly=True)
> > owner = exported(
> > - title=_('Owner'), required=False, readonly=True,
> > - vocabulary=
> > - reviewer = PublicPersonChoice(
> > - title=_
> > - vocabulary=
> > + title=_('Owner'), description=_("The person who is set as the "
> > + "current administrator of this mirror."), required=True,
> > + readonly=False, vocabulary=
>
> So the owner attribute is no-longer readonly? If that's intentional, we really
> should have that tested/documented (ie. who can/can't write to it).
This is now tested in registry/
> Also, just a few small indentation things looking at
> the style guide. It might be easier to format this like:
>
> title=_('Owner'), description=_(
> "The person who is set as the current administrator of this mirror."),
> required=True, readonly=False, vocabulary=
>
> or
>
> title=_('Owner'), required=True, readonly=False, vocabulary=
> description=_(
> "The person who is set as the current administrator of this mirror."))
I've changed all the fields to the latter.
> > + reviewer = exported(
> > + title=_
> > + "mirror."), required=False, readonly=True,
> > + vocabulary=
>
> So the main change is that readonly is now true. Please ensure this is tested
> also.
Also done.
> Similar formatting issues here. Although, I can't see anything in the
> style-guide, but I thought that concatenated strings needed to be aligned (if
> you have to break them).
>
> > distribution = exported(
> > Reference(
> > Interface,
> > # Really IDistribution, circular import fixed in
> > # _schema_
> > - title=_
> > + title=_
>
> Again, this needs to be tested (so it doesn't happen again).
This is now tested.
> > description=_("The distribution that is mirrored")))
> > name = exported(
> > title=_('Name'), required=True, readonly=False,
> > @@ -325,7 +327,7 @@
> > description=
> > enabled = exported(Bool(
> > title=_('This mirror was probed successfully.'),
> > - required=False, readonly=False, default=False))
> > + required=False, readonly=True, default=False))
>
> And here too.
Likewise.
> > speed = exported(Choice(
> > title=_('Link Speed'), required=True, readonly=False,
> > vocabul...
Michael Nelson (michael.nelson) wrote : | # |
Thanks for the changes Jonathan. I've approved the review, but do have a couple of things below that I'm interested to hear back on (they could be just oversights on my part).
> Done and full diff since r10278:
> === modified file 'lib/lp/
> mirror.txt'
> --- lib/lp/
> 2010-02-04 12:22:19 +0000
> +++ lib/lp/
> 2010-02-05 11:32:41 +0000
> @@ -57,6 +57,88 @@
> status: u'Official'
> whiteboard: None
>
> += Security checks =
> +
> +People who are not mirror listing admins or the mirrors registrar may not
> +change the owner's of mirrors:
> +
> + >>> from canonical.
> + >>> from canonical.
> + >>> from zope.component import getUtility
> + >>> from lp.registry.
> + >>> from simplejson import dumps
> + >>> login(ANONYMOUS)
> + >>> karl_db = getUtility(
> + >>> test_db = getUtility(
> + >>> karl_webservice = webservice_
> + ... permission=
> + >>> test_webservice = webservice_
> + ... permission=
> + >>> logout()
> + >>> karl = webservice.
> + >>> patch = {
> + ... u'owner_link': karl['self_link']
> + ... }
> +
> +Now trying to set the owner using Sample Person's webservice is not
> authorized.
> +
> + >>> response = test_webservice
> + ... canonical_
> + >>> print response.
> + 401 Unauthorized
> +
> +But if we use Karl, the mirror listing admin's, webservice, we can update the
s/admin's,/admin's
> owner.
> +
> + >>> response = karl_webservice
> + ... canonical_
> + >>> print response.
> + 209 Content Returned
> +
> + >>> patched_
> + >>> print patched_
> + http://
> +
> +Some attributes are read-only via the API:
> +
> + >>> distros = webservice.
> + >>> distro = distros[
> + >>> debian = webservice.
I haven't checked, but is the above line necessary? you're getting distro['self_link'] which should be equivalent to distro? (ie. distro == debian?). Actually, you only seem to use debian['self_link'] below anyway (which should be equivalent to distro['self_link'] unless I'm missing something).
> + >>> patch = {
> + ... u'date_reviewed' : u'2010-
> + ... u'distribution_
> + ... u'enabled' : False,
> + ... u'reviewer_link' : karl['self_link']
> + ... }
> + >>> response = karl_webservice
> + ... canonical_
> dum...
Jonathan Davies (jpds) wrote : | # |
The branch failed a test on distribution.txt, as I was just testing distribution-
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -124,18 +124,20 @@
>>> pprint_
content: u'CD Image'
date_created: u'2006-
+ date_reviewed: None
description: None
displayname: None
distributi
enabled: True
ftp_base_url: None
- has_ftp_
http_base_url: u'http://
name: u'canonical-
official_
owner_link: u'http://
+ reviewer_link: None
resource_
rsync_
self_link: u'http://
speed: u'100 Mbps'
status: u'Official'
+ whiteboard: None
Jonathan Davies (jpds) wrote : | # |
>> >>> is_official_mirror =
>> webservice.
>> ... 'isOfficial'
>> >>> print is_official_mirror
>> - True
>> + False
>
> I can't see anything that should have changed the expected value of this test? Why did it
> change here?
For the record:
<noodles> Also, I can't see why the expected value of is_official_mirror changed at the end of your diff?
<jpds> 13:47:01 <jpds> is_o_m> IT changes because I patch it with: u'status' : 'Unofficial'
Brad Crittenden (bac) wrote : | # |
Your additional test changes look good. Thanks.
Preview Diff
1 | === modified file 'lib/lp/registry/interfaces/distributionmirror.py' | |||
2 | --- lib/lp/registry/interfaces/distributionmirror.py 2010-02-01 23:17:27 +0000 | |||
3 | +++ lib/lp/registry/interfaces/distributionmirror.py 2010-02-05 18:56:19 +0000 | |||
4 | @@ -287,17 +287,19 @@ | |||
5 | 287 | 287 | ||
6 | 288 | id = Int(title=_('The unique id'), required=True, readonly=True) | 288 | id = Int(title=_('The unique id'), required=True, readonly=True) |
7 | 289 | owner = exported(PublicPersonChoice( | 289 | owner = exported(PublicPersonChoice( |
13 | 290 | title=_('Owner'), required=False, readonly=True, | 290 | title=_('Owner'), readonly=False, vocabulary='ValidOwner', |
14 | 291 | vocabulary='ValidOwner')) | 291 | required=True, description=_( |
15 | 292 | reviewer = PublicPersonChoice( | 292 | "The person who is set as the current administrator of this mirror."))) |
16 | 293 | title=_('Reviewer'), required=False, readonly=False, | 293 | reviewer = exported(PublicPersonChoice( |
17 | 294 | vocabulary='ValidPersonOrTeam') | 294 | title=_('Reviewer'), required=False, readonly=True, |
18 | 295 | vocabulary='ValidPersonOrTeam', description=_( | ||
19 | 296 | "The person who last reviewed this mirror."))) | ||
20 | 295 | distribution = exported( | 297 | distribution = exported( |
21 | 296 | Reference( | 298 | Reference( |
22 | 297 | Interface, | 299 | Interface, |
23 | 298 | # Really IDistribution, circular import fixed in | 300 | # Really IDistribution, circular import fixed in |
24 | 299 | # _schema_circular_imports. | 301 | # _schema_circular_imports. |
26 | 300 | title=_("Distribution"), required=True, | 302 | title=_("Distribution"), required=True, readonly=True, |
27 | 301 | description=_("The distribution that is mirrored"))) | 303 | description=_("The distribution that is mirrored"))) |
28 | 302 | name = exported(DistributionMirrorNameField( | 304 | name = exported(DistributionMirrorNameField( |
29 | 303 | title=_('Name'), required=True, readonly=False, | 305 | title=_('Name'), required=True, readonly=False, |
30 | @@ -325,7 +327,7 @@ | |||
31 | 325 | description=_('e.g.: rsync://archive.ubuntu.com/ubuntu/'))) | 327 | description=_('e.g.: rsync://archive.ubuntu.com/ubuntu/'))) |
32 | 326 | enabled = exported(Bool( | 328 | enabled = exported(Bool( |
33 | 327 | title=_('This mirror was probed successfully.'), | 329 | title=_('This mirror was probed successfully.'), |
35 | 328 | required=False, readonly=False, default=False)) | 330 | required=False, readonly=True, default=False)) |
36 | 329 | speed = exported(Choice( | 331 | speed = exported(Choice( |
37 | 330 | title=_('Link Speed'), required=True, readonly=False, | 332 | title=_('Link Speed'), required=True, readonly=False, |
38 | 331 | vocabulary=MirrorSpeed)) | 333 | vocabulary=MirrorSpeed)) |
39 | @@ -344,7 +346,8 @@ | |||
40 | 344 | required=False, readonly=False, default=True)) | 346 | required=False, readonly=False, default=True)) |
41 | 345 | status = exported(Choice( | 347 | status = exported(Choice( |
42 | 346 | title=_('Status'), required=True, readonly=False, | 348 | title=_('Status'), required=True, readonly=False, |
44 | 347 | vocabulary=MirrorStatus)) | 349 | vocabulary=MirrorStatus, |
45 | 350 | description=_("The current status of a mirror's registration."))) | ||
46 | 348 | 351 | ||
47 | 349 | title = Attribute('The title of this mirror') | 352 | title = Attribute('The title of this mirror') |
48 | 350 | cdimage_series = Attribute( | 353 | cdimage_series = Attribute( |
49 | @@ -355,17 +358,20 @@ | |||
50 | 355 | last_probe_record = Attribute( | 358 | last_probe_record = Attribute( |
51 | 356 | 'The last MirrorProbeRecord for this mirror.') | 359 | 'The last MirrorProbeRecord for this mirror.') |
52 | 357 | all_probe_records = Attribute('All MirrorProbeRecords for this mirror.') | 360 | all_probe_records = Attribute('All MirrorProbeRecords for this mirror.') |
55 | 358 | has_ftp_or_rsync_base_url = exported(Bool( | 361 | has_ftp_or_rsync_base_url = Bool( |
56 | 359 | title=_('Does this mirror have a ftp or rsync base URL?'))) | 362 | title=_('Does this mirror have a FTP or Rsync base URL?')) |
57 | 360 | base_url = Attribute('The HTTP or FTP base URL of this mirror') | 363 | base_url = Attribute('The HTTP or FTP base URL of this mirror') |
58 | 361 | date_created = exported(Datetime( | 364 | date_created = exported(Datetime( |
64 | 362 | title=_('Date Created'), required=True, readonly=True)) | 365 | title=_('Date Created'), required=True, readonly=True, |
65 | 363 | date_reviewed = Datetime( | 366 | description=_("The date on which this mirror was registered."))) |
66 | 364 | title=_('Date reviewed'), required=False, readonly=False) | 367 | date_reviewed = exported(Datetime( |
67 | 365 | whiteboard = Whiteboard( | 368 | title=_('Date reviewed'), required=False, readonly=True, |
68 | 366 | title=_('Whiteboard'), required=False, | 369 | description=_( |
69 | 370 | "The date on which this mirror was last reviewed by a mirror admin."))) | ||
70 | 371 | whiteboard = exported(Whiteboard( | ||
71 | 372 | title=_('Whiteboard'), required=False, readonly=False, | ||
72 | 367 | description=_("Notes on the current status of the mirror (only " | 373 | description=_("Notes on the current status of the mirror (only " |
74 | 368 | "visible to admins and the mirror's registrant).")) | 374 | "visible to admins and the mirror's registrant)."))) |
75 | 369 | 375 | ||
76 | 370 | @invariant | 376 | @invariant |
77 | 371 | def mirrorMustHaveHTTPOrFTPURL(mirror): | 377 | def mirrorMustHaveHTTPOrFTPURL(mirror): |
78 | 372 | 378 | ||
79 | === modified file 'lib/lp/registry/stories/webservice/xx-distribution-mirror.txt' | |||
80 | --- lib/lp/registry/stories/webservice/xx-distribution-mirror.txt 2010-02-01 23:17:27 +0000 | |||
81 | +++ lib/lp/registry/stories/webservice/xx-distribution-mirror.txt 2010-02-05 18:56:19 +0000 | |||
82 | @@ -13,21 +13,23 @@ | |||
83 | 13 | >>> pprint_entry(canonical_archive_json) | 13 | >>> pprint_entry(canonical_archive_json) |
84 | 14 | content: u'Archive' | 14 | content: u'Archive' |
85 | 15 | date_created: u'2006-10-16T18:31:43.434567+00:00' | 15 | date_created: u'2006-10-16T18:31:43.434567+00:00' |
86 | 16 | date_reviewed: None | ||
87 | 16 | description: None | 17 | description: None |
88 | 17 | displayname: None | 18 | displayname: None |
89 | 18 | distribution_link: u'http://.../ubuntu' | 19 | distribution_link: u'http://.../ubuntu' |
90 | 19 | enabled: True | 20 | enabled: True |
91 | 20 | ftp_base_url: None | 21 | ftp_base_url: None |
92 | 21 | has_ftp_or_rsync_base_url: False | ||
93 | 22 | http_base_url: u'http://archive.ubuntu.com/ubuntu/' | 22 | http_base_url: u'http://archive.ubuntu.com/ubuntu/' |
94 | 23 | name: u'canonical-archive' | 23 | name: u'canonical-archive' |
95 | 24 | official_candidate: True | 24 | official_candidate: True |
96 | 25 | owner_link: u'http://.../~mark' | 25 | owner_link: u'http://.../~mark' |
97 | 26 | resource_type_link: u'http://.../#distribution_mirror' | 26 | resource_type_link: u'http://.../#distribution_mirror' |
98 | 27 | reviewer_link: None | ||
99 | 27 | rsync_base_url: None | 28 | rsync_base_url: None |
100 | 28 | self_link: u'http://.../ubuntu/+mirror/canonical-archive' | 29 | self_link: u'http://.../ubuntu/+mirror/canonical-archive' |
101 | 29 | speed: u'100 Mbps' | 30 | speed: u'100 Mbps' |
102 | 30 | status: u'Official' | 31 | status: u'Official' |
103 | 32 | whiteboard: None | ||
104 | 31 | 33 | ||
105 | 32 | And CD image mirrors: | 34 | And CD image mirrors: |
106 | 33 | 35 | ||
107 | @@ -37,21 +39,104 @@ | |||
108 | 37 | >>> pprint_entry(canonical_releases_json) | 39 | >>> pprint_entry(canonical_releases_json) |
109 | 38 | content: u'CD Image' | 40 | content: u'CD Image' |
110 | 39 | date_created: u'2006-10-16T18:31:43.434567+00:00' | 41 | date_created: u'2006-10-16T18:31:43.434567+00:00' |
111 | 42 | date_reviewed: None | ||
112 | 40 | description: None | 43 | description: None |
113 | 41 | displayname: None | 44 | displayname: None |
114 | 42 | distribution_link: u'http://.../ubuntu' | 45 | distribution_link: u'http://.../ubuntu' |
115 | 43 | enabled: True | 46 | enabled: True |
116 | 44 | ftp_base_url: None | 47 | ftp_base_url: None |
117 | 45 | has_ftp_or_rsync_base_url: False | ||
118 | 46 | http_base_url: u'http://releases.ubuntu.com/' | 48 | http_base_url: u'http://releases.ubuntu.com/' |
119 | 47 | name: u'canonical-releases' | 49 | name: u'canonical-releases' |
120 | 48 | official_candidate: True | 50 | official_candidate: True |
121 | 49 | owner_link: u'http://.../~mark' | 51 | owner_link: u'http://.../~mark' |
122 | 50 | resource_type_link: u'http://.../#distribution_mirror' | 52 | resource_type_link: u'http://.../#distribution_mirror' |
123 | 53 | reviewer_link: None | ||
124 | 51 | rsync_base_url: None | 54 | rsync_base_url: None |
125 | 52 | self_link: u'http://.../ubuntu/+mirror/canonical-releases' | 55 | self_link: u'http://.../ubuntu/+mirror/canonical-releases' |
126 | 53 | speed: u'100 Mbps' | 56 | speed: u'100 Mbps' |
127 | 54 | status: u'Official' | 57 | status: u'Official' |
128 | 58 | whiteboard: None | ||
129 | 59 | |||
130 | 60 | = Security checks = | ||
131 | 61 | |||
132 | 62 | People who are not mirror listing admins or the mirrors registrar may not | ||
133 | 63 | change the owner's of mirrors: | ||
134 | 64 | |||
135 | 65 | >>> from canonical.launchpad.testing.pages import webservice_for_person | ||
136 | 66 | >>> from canonical.launchpad.webapp.interfaces import OAuthPermission | ||
137 | 67 | >>> from zope.component import getUtility | ||
138 | 68 | >>> from lp.registry.interfaces.person import IPersonSet | ||
139 | 69 | >>> from simplejson import dumps | ||
140 | 70 | >>> login(ANONYMOUS) | ||
141 | 71 | >>> karl_db = getUtility(IPersonSet).getByName('karl') | ||
142 | 72 | >>> test_db = getUtility(IPersonSet).getByName('name12') | ||
143 | 73 | >>> karl_webservice = webservice_for_person(karl_db, | ||
144 | 74 | ... permission=OAuthPermission.WRITE_PUBLIC) | ||
145 | 75 | >>> test_webservice = webservice_for_person(test_db, | ||
146 | 76 | ... permission=OAuthPermission.WRITE_PUBLIC) | ||
147 | 77 | >>> logout() | ||
148 | 78 | >>> karl = webservice.get("/~karl").jsonBody() | ||
149 | 79 | >>> patch = { | ||
150 | 80 | ... u'owner_link': karl['self_link'] | ||
151 | 81 | ... } | ||
152 | 82 | |||
153 | 83 | Now trying to set the owner using Sample Person's webservice is not authorized. | ||
154 | 84 | |||
155 | 85 | >>> response = test_webservice.patch( | ||
156 | 86 | ... canonical_archive['self_link'], 'application/json', dumps(patch)) | ||
157 | 87 | >>> print response.getheader('status') | ||
158 | 88 | 401 Unauthorized | ||
159 | 89 | |||
160 | 90 | But if we use Karl, the mirror listing admin's, webservice, we can update the owner. | ||
161 | 91 | |||
162 | 92 | >>> response = karl_webservice.patch( | ||
163 | 93 | ... canonical_archive['self_link'], 'application/json', dumps(patch)) | ||
164 | 94 | >>> print response.getheader('status') | ||
165 | 95 | 209 Content Returned | ||
166 | 96 | |||
167 | 97 | >>> patched_canonical_archive = response.jsonBody() | ||
168 | 98 | >>> print patched_canonical_archive['owner_link'] | ||
169 | 99 | http://.../~karl | ||
170 | 100 | |||
171 | 101 | Some attributes are read-only via the API: | ||
172 | 102 | |||
173 | 103 | >>> distros = webservice.get("/distros").jsonBody() | ||
174 | 104 | >>> debian_distro = distros['entries'][3] | ||
175 | 105 | >>> patch = { | ||
176 | 106 | ... u'date_reviewed' : u'2010-02-04T17:19:16.424198+00:00', | ||
177 | 107 | ... u'distribution_link' : debian_distro['self_link'], | ||
178 | 108 | ... u'enabled' : False, | ||
179 | 109 | ... u'reviewer_link' : karl['self_link'] | ||
180 | 110 | ... } | ||
181 | 111 | >>> response = karl_webservice.patch( | ||
182 | 112 | ... canonical_releases['self_link'], 'application/json', dumps(patch)) | ||
183 | 113 | >>> print response | ||
184 | 114 | HTTP/1.1 400 Bad Request | ||
185 | 115 | Status: 400 Bad Request | ||
186 | 116 | ... | ||
187 | 117 | enabled: You tried to modify a read-only attribute. | ||
188 | 118 | date_reviewed: You tried to modify a read-only attribute. | ||
189 | 119 | reviewer_link: You tried to modify a read-only attribute. | ||
190 | 120 | distribution_link: You tried to modify a read-only attribute. | ||
191 | 121 | |||
192 | 122 | While others can be set with the appropriate authorization: | ||
193 | 123 | |||
194 | 124 | >>> patch = { | ||
195 | 125 | ... u'status' : 'Unofficial', | ||
196 | 126 | ... u'whiteboard' : u'This mirror is too shiny to be true' | ||
197 | 127 | ... } | ||
198 | 128 | >>> response = test_webservice.patch( | ||
199 | 129 | ... canonical_releases['self_link'], 'application/json', dumps(patch)) | ||
200 | 130 | >>> print response.getheader('status') | ||
201 | 131 | 401 Unauthorized | ||
202 | 132 | |||
203 | 133 | >>> response = karl_webservice.patch( | ||
204 | 134 | ... canonical_releases['self_link'], 'application/json', dumps(patch)).jsonBody() | ||
205 | 135 | >>> pprint_entry(response) | ||
206 | 136 | content: u'CD Image' | ||
207 | 137 | ... | ||
208 | 138 | status: u'Unofficial' | ||
209 | 139 | whiteboard: u'This mirror is too shiny to be true' | ||
210 | 55 | 140 | ||
211 | 56 | = Distribution Mirror Custom Operations = | 141 | = Distribution Mirror Custom Operations = |
212 | 57 | 142 | ||
213 | @@ -63,7 +148,7 @@ | |||
214 | 63 | >>> is_official_mirror = webservice.named_get(canonical_releases['self_link'], | 148 | >>> is_official_mirror = webservice.named_get(canonical_releases['self_link'], |
215 | 64 | ... 'isOfficial').jsonBody() | 149 | ... 'isOfficial').jsonBody() |
216 | 65 | >>> print is_official_mirror | 150 | >>> print is_official_mirror |
218 | 66 | True | 151 | False |
219 | 67 | 152 | ||
220 | 68 | "getOverallFreshness" returns the freshness of the mirror determined by the | 153 | "getOverallFreshness" returns the freshness of the mirror determined by the |
221 | 69 | mirror prober from the mirror's last probe. | 154 | mirror prober from the mirror's last probe. |
222 | 70 | 155 | ||
223 | === modified file 'lib/lp/registry/stories/webservice/xx-distribution.txt' | |||
224 | --- lib/lp/registry/stories/webservice/xx-distribution.txt 2010-02-01 23:17:27 +0000 | |||
225 | +++ lib/lp/registry/stories/webservice/xx-distribution.txt 2010-02-05 18:56:19 +0000 | |||
226 | @@ -124,18 +124,20 @@ | |||
227 | 124 | >>> pprint_entry(canonical_releases) | 124 | >>> pprint_entry(canonical_releases) |
228 | 125 | content: u'CD Image' | 125 | content: u'CD Image' |
229 | 126 | date_created: u'2006-10-16T18:31:43.434567+00:00' | 126 | date_created: u'2006-10-16T18:31:43.434567+00:00' |
230 | 127 | date_reviewed: None | ||
231 | 127 | description: None | 128 | description: None |
232 | 128 | displayname: None | 129 | displayname: None |
233 | 129 | distribution_link: u'http://.../ubuntu' | 130 | distribution_link: u'http://.../ubuntu' |
234 | 130 | enabled: True | 131 | enabled: True |
235 | 131 | ftp_base_url: None | 132 | ftp_base_url: None |
236 | 132 | has_ftp_or_rsync_base_url: False | ||
237 | 133 | http_base_url: u'http://releases.ubuntu.com/' | 133 | http_base_url: u'http://releases.ubuntu.com/' |
238 | 134 | name: u'canonical-releases' | 134 | name: u'canonical-releases' |
239 | 135 | official_candidate: True | 135 | official_candidate: True |
240 | 136 | owner_link: u'http://.../~mark' | 136 | owner_link: u'http://.../~mark' |
241 | 137 | resource_type_link: u'http://.../#distribution_mirror' | 137 | resource_type_link: u'http://.../#distribution_mirror' |
242 | 138 | reviewer_link: None | ||
243 | 138 | rsync_base_url: None | 139 | rsync_base_url: None |
244 | 139 | self_link: u'http://.../ubuntu/+mirror/canonical-releases' | 140 | self_link: u'http://.../ubuntu/+mirror/canonical-releases' |
245 | 140 | speed: u'100 Mbps' | 141 | speed: u'100 Mbps' |
246 | 141 | status: u'Official' | 142 | status: u'Official' |
247 | 143 | whiteboard: None |
= Summary =
This branch fixes various problems with the newly exposed distribution_ mirror' s as described in bug #517020.
It also exposes various other things whose permissions to access are restricted by Zope's configuration.