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

Issue 10732045: Implement more methods in the Azure provider.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by rvb
Modified:
10 years, 9 months ago
Reviewers:
jtv.canonical, mp+171966
Visibility:
Public.

Description

Implement more methods in the Azure provider. In the Azure provider, this branch implements environ's Instances() and AllInstances() methods and instance's Id(), DNSName() and WaitDNSName() methods. Nothing particularly noteworthy about the implementation: all the methods are implemented by doing simple calls to gwacl's methods. The tests are made relatively simple by the usage of the new test utility methods that gwacl provides. You'll see that I have decided, in tests, to only check that _a_ request was made to the fake Azure server rather that checking the exact nature of the request. The gwacl methods are themselves properly unittested so I decided it would do more bad than good to put too much Azure-specific stuff (such as the requested url) in the provider's test code. https://code.launchpad.net/~rvb/juju-core/az-list-instances/+merge/171966 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 15
Unified diffs Side-by-side diffs Delta from patch set Stats (+165 lines, -12 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M environs/azure/environ.go View 1 chunk +44 lines, -2 lines 9 comments Download
M environs/azure/environ_test.go View 2 chunks +60 lines, -0 lines 3 comments Download
M environs/azure/instance.go View 1 chunk +16 lines, -10 lines 1 comment Download
A environs/azure/instance_test.go View 1 chunk +43 lines, -0 lines 2 comments Download

Messages

Total messages: 10
rvb
Please take a look.
10 years, 9 months ago (2013-06-28 09:01:22 UTC) #1
jtv.canonical
not LGTM — by and large I like this branch a lot, but there are ...
10 years, 9 months ago (2013-06-28 14:54:20 UTC) #2
rvb
On 2013/06/28 14:54:20, jtv.canonical wrote: > not LGTM — by and large I like this ...
10 years, 9 months ago (2013-06-28 15:55:37 UTC) #3
jtv.canonical
On 2013/06/28 15:55:37, rvb wrote: > If gwacl provider a ListAllDeployments, this would probably be ...
10 years, 9 months ago (2013-06-28 18:22:40 UTC) #4
rvb
On 2013/06/28 18:22:40, jtv.canonical wrote: > On 2013/06/28 15:55:37, rvb wrote: > > > If ...
10 years, 9 months ago (2013-06-28 20:07:19 UTC) #5
jtv.canonical
And also, conflicts. :( I'm sorry, that too is my fault. The easy part is ...
10 years, 9 months ago (2013-06-29 10:54:04 UTC) #6
rvb
On 2013/06/29 10:54:04, jtv.canonical wrote: > And also, conflicts. :( I'm sorry, that too is ...
10 years, 9 months ago (2013-06-29 11:03:00 UTC) #7
jtv.canonical
LGTM by the way! Thanks for making the changes. Instances() and AllInstances() are long, but ...
10 years, 9 months ago (2013-06-29 11:52:39 UTC) #8
rvb
On 2013/06/29 11:52:39, jtv.canonical wrote: > LGTM by the way! Thanks for making the changes. ...
10 years, 9 months ago (2013-06-29 14:36:38 UTC) #9
jtv.canonical
10 years, 9 months ago (2013-06-29 15:08:30 UTC) #10
> I'd rather leave the special case:
> a) all the other providers do that
> b) with the ErrNoInstances error stuff and if I remove the special case, if
you
> pass an empty list of instance ids, you'll get an error.  That clearly does
not
> feel right to me, if you give it a list of empty instances ids, no error
should
> happen IMHO…

Absolutely fine with me.  Just mentioning it as an illustration, not as
something I feel needs changing!


> Well, spotted, I've added that case (and a test).

I did the same for the MAAS provider, which was already implemented by the time
this interface change was made, but was never updated to match it.  It's up for
review now.

By the way, as far as I can see, we're probably expected to return
ErrNoInstances even when zero instances are requested.  Otherwise, StateInfo()
may keep looping until its timeout in cases where no instances have been created
yet, thinking that it's going to get them later.

And oh, stop working on your weekend!  :-)
Sign in to reply to this message.

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