Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(194)

Issue 6777067: Restore compatibility with MaaS 1.0 in provider

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 4 months ago by gz
Modified:
13 years, 3 months ago
Reviewers:
jimbaker, mp+131724, gzlist
Visibility:
Public.

Description

Restore compatibility with MaaS 1.0 in provider For supporting the new constraints in MaaS, two changes to the maas provider were needed. Passing extra parameters to acquire is okay, as they just get ignored. However, listing tags is a new api call, so returns 404 in the old version. To work around this, any http errors when listing tags are now treated as meaning there are no valid tags, rather than raising. https://code.launchpad.net/~gz/juju/maas_tagless_compat_1068566/+merge/131724 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -3 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M juju/providers/maas/maas.py View 4 chunks +15 lines, -2 lines 1 comment Download
M juju/providers/maas/tests/test_maas.py View 3 chunks +22 lines, -1 line 0 comments Download

Messages

Total messages: 3
gz
Please take a look.
13 years, 4 months ago (2012-10-27 07:52:14 UTC) #1
jimbaker
+1, LGTM. https://codereview.appspot.com/6777067/diff/1/juju/providers/maas/maas.py File juju/providers/maas/maas.py (right): https://codereview.appspot.com/6777067/diff/1/juju/providers/maas/maas.py#newcode193 juju/providers/maas/maas.py:193: return self.get("api/1.0/tags/", params).addErrback( Reasonable, but why not ...
13 years, 3 months ago (2012-10-29 11:34:40 UTC) #2
gzlist
13 years, 3 months ago (2012-10-29 15:28:46 UTC) #3
On 2012/10/29 11:34:40, jimbaker wrote:
> +1, LGTM.
> 
> https://codereview.appspot.com/6777067/diff/1/juju/providers/maas/maas.py
> File juju/providers/maas/maas.py (right):
> 
>
https://codereview.appspot.com/6777067/diff/1/juju/providers/maas/maas.py#new...
> juju/providers/maas/maas.py:193: return self.get("api/1.0/tags/",
> params).addErrback(
> Reasonable, but why not use @inlineCallbacks and simplify error processing:
> 
>          try:
>              tags = yield self.get("api/1.0/tags/",  {"op": "list"})
>          except ProviderError:
>              log.exception("Listing valid maas-tags failed")
>              tags = []
>          returnValue(tags)

Yes, that's a reasonable change, I just developed a phobia a inlineCallbacks
when writing the test before the bug fix.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b