Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(135)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Issue 77850043: Added network inclusion/exclusion to acquireNode

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 9 months ago by hduran
Modified:
11 years, 9 months ago
Reviewers:
rvb , mp+211748, natefinch
Visibility:
Public.
Added network inclusion/exclusion to acquireNode I added Networks structure as a parameter of acquireNode in maas provider. Its two members IncludedNetworks and ExcludedNetworks get converted, in a similar fashion than constraints, into url encoded parameters, according to ~maas-maintainers/maas/trunk/view/head:/docs/networks.rst they become, respectively "networks" and "not_networks" For this I create an analog to convertConstraints which I called convertNetworks, mostly to keep the two conceptually separated. I added testing for the four variants I could think of the structure values that where representative. I also made a small cosmetic change to the converConstraints test since it was very hard to read and I needed to based my own test on it https://code.launchpad.net/~hduran-8/juju-core/add_networks_to_maas_acquireNode/+merge/211748 Requires: https://code.launchpad.net/~gz/juju-core/add_startinstance_params/+merge/211588 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 5

Patch Set 2 : Added network inclusion/exclusion to acquireNode #

Patch Set 3 : Added network inclusion/exclusion to acquireNode #

Created: 11 years, 9 months ago
Download [raw] [tar.bz2]
Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -19 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M provider/maas/environ.go View 1 2 2 chunks +20 lines, -2 lines 0 comments Download
M provider/maas/environ_whitebox_test.go View 1 2 4 chunks +63 lines, -17 lines 0 comments Download
Total messages: 9
|
hduran
Please take a look.
11 years, 9 months ago (2014年03月19日 15:09:13 UTC) #1
Please take a look.
Sign in to reply to this message.
natefinch
On 2014年03月19日 15:09:13, hduran wrote: > Please take a look. LGTM with one slight change.
11 years, 9 months ago (2014年03月19日 15:32:34 UTC) #2
On 2014年03月19日 15:09:13, hduran wrote:
> Please take a look.
LGTM with one slight change.
Sign in to reply to this message.
natefinch
Doh, forgot to do the publish and mail thing. Here's the change I mentioned before. ...
11 years, 9 months ago (2014年03月19日 15:33:52 UTC) #3
Doh, forgot to do the publish and mail thing. Here's the change I mentioned
before.
https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go
File provider/maas/environ.go (right):
https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go#newco...
provider/maas/environ.go:172: func convertNetworks(params *url.Values, nets
environs.Networks) {
I'd rename this to be addNetworks, since it's adding on to the url.Values that
you pass in.
Also, don't actually need to make it a pointer, since url.Values is actually
just a map, and internally, maps are pointers to data structures, so you can
pass them like they're already a pointer.
Sign in to reply to this message.
hduran
Please take a look. https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go File provider/maas/environ.go (right): https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go#newcode172 provider/maas/environ.go:172: func convertNetworks(params *url.Values, nets environs.Networks) ...
11 years, 9 months ago (2014年03月19日 15:48:15 UTC) #4
Please take a look.
https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go
File provider/maas/environ.go (right):
https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go#newco...
provider/maas/environ.go:172: func convertNetworks(params *url.Values, nets
environs.Networks) {
On 2014年03月19日 15:33:52, nate.finch wrote:
> I'd rename this to be addNetworks, since it's adding on to the url.Values that
> you pass in.
> 
> Also, don't actually need to make it a pointer, since url.Values is actually
> just a map, and internally, maps are pointers to data structures, so you can
> pass them like they're already a pointer.
Done.
Sign in to reply to this message.
hduran
I did change the name, it makes more sense now. Also I changed params to ...
11 years, 9 months ago (2014年03月19日 15:48:44 UTC) #5
I did change the name, it makes more sense now.
Also I changed params to be just passed as value.
Thank you.
Sign in to reply to this message.
rvb
https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go File provider/maas/environ.go (right): https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go#newcode175 provider/maas/environ.go:175: //XXX Is this suposed to be a comma separated ...
11 years, 9 months ago (2014年03月19日 15:51:32 UTC) #6
https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go
File provider/maas/environ.go (right):
https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go#newco...
provider/maas/environ.go:175: //XXX Is this suposed to be a comma separated
list?
No, MAAs doesn't expect a comma-separated list, it wants a multi-valued URL
parameter.
As in http://server/?networks=net1&networks=net2
i.e.
v := url.Values{}
v.Add("networks", "<network1>")
v.Add("networks", "<network2>")
Sign in to reply to this message.
hduran
Please take a look. https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go File provider/maas/environ.go (right): https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go#newcode175 provider/maas/environ.go:175: //XXX Is this suposed to ...
11 years, 9 months ago (2014年03月19日 16:10:31 UTC) #7
Please take a look.
https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go
File provider/maas/environ.go (right):
https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go#newco...
provider/maas/environ.go:175: //XXX Is this suposed to be a comma separated
list?
On 2014年03月19日 15:51:33, rvb wrote:
> No, MAAs doesn't expect a comma-separated list, it wants a multi-valued URL
> parameter.
> 
> As in http://server/?networks=net1&networks=net2
> i.e.
> v := url.Values{}
> v.Add("networks", "<network1>")
> v.Add("networks", "<network2>")
Done.
https://codereview.appspot.com/77850043/diff/1/provider/maas/environ.go#newco...
provider/maas/environ.go:175: //XXX Is this suposed to be a comma separated
list?
On 2014年03月19日 15:51:33, rvb wrote:
> No, MAAs doesn't expect a comma-separated list, it wants a multi-valued URL
> parameter.
> 
> As in http://server/?networks=net1&networks=net2
> i.e.
> v := url.Values{}
> v.Add("networks", "<network1>")
> v.Add("networks", "<network2>")
Done.
Sign in to reply to this message.
rvb
[...] > Done. Thanks for the changes. LGTM.
11 years, 9 months ago (2014年03月19日 16:41:26 UTC) #8
[...]
> Done.
Thanks for the changes.
LGTM.
Sign in to reply to this message.
natefinch
LGTM
11 years, 9 months ago (2014年03月19日 18:47:25 UTC) #9
LGTM
Sign in to reply to this message.
|
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /