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
(55)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Issue 14307043: ec2,openstack: control-bucket set in Prepare

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by fwereade
Modified:
12 years, 3 months ago
Reviewers:
mue , gz , mp+188955, rog
Visibility:
Public.
ec2,openstack: control-bucket set in Prepare https://code.launchpad.net/~fwereade/juju-core/prepare-control-bucket/+merge/188955 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 3
Created: 12 years, 3 months ago
Download [raw] [tar.bz2]
Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -15 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M provider/ec2/config_test.go View 1 chunk +34 lines, -0 lines 0 comments Download
M provider/ec2/ec2.go View 1 chunk +13 lines, -14 lines 2 comments Download
M provider/openstack/config_test.go View 1 chunk +36 lines, -0 lines 0 comments Download
M provider/openstack/provider.go View 1 chunk +12 lines, -1 line 1 comment Download
Total messages: 6
|
fwereade
Please take a look.
12 years, 3 months ago (2013年10月02日 22:44:16 UTC) #1
Please take a look.
Sign in to reply to this message.
gz
LGTM, but the two-versions is crying out for some ec2-openstack unification of tests and code.
12 years, 3 months ago (2013年10月02日 23:13:12 UTC) #2
LGTM, but the two-versions is crying out for some ec2-openstack unification of
tests and code.
Sign in to reply to this message.
rog
LGTM with one suggestion (it could use some better names though) https://codereview.appspot.com/14307043/diff/1/provider/ec2/ec2.go File provider/ec2/ec2.go (right): ...
12 years, 3 months ago (2013年10月02日 23:38:05 UTC) #3
LGTM with one suggestion (it could use some better names though)
https://codereview.appspot.com/14307043/diff/1/provider/ec2/ec2.go
File provider/ec2/ec2.go (right):
https://codereview.appspot.com/14307043/diff/1/provider/ec2/ec2.go#newcode205
provider/ec2/ec2.go:205: if _, ok := attrs["control-bucket"]; !ok {
Thinking about mgz's remark, how about a little helper in provider/common, which
should be useful for other prepare cases too?
type DefaultAttrs map[string] func() (interface{}, error)
// AddDefaults returns the given configuration with any
// defaults in newAttr added.
func AddDefaults(cfg *config.Config, newAttr DefaultAttrs) (*config.Config,
error) {
 attrs := cfg.AllAttrs()
 for attr, makeAttr := range newAttr {
 if _, ok := attrs[attr]; ok {
 continue
 }
 new, err := makeAttr()
 if err != nil {
 return nil, err
 }
 attrs[attr] = new
 }
 return cfg.Apply(attrs)
}
Then the code here becomes:
cfg, err := common.AddDefaults(cfg, common.DefaultAttrs{
 "control-bucket": func() (interface{}, error) { return utils.NewUUID() },
})
Sign in to reply to this message.
fwereade
With some shame, I'm calling this two-strikes-not-three. It *will* be three when I get to ...
12 years, 3 months ago (2013年10月02日 23:48:15 UTC) #4
With some shame, I'm calling this two-strikes-not-three. It *will* be three when
I get to landing a skeleton provider, though, and that's on its way.
Sign in to reply to this message.
rog
You could put my suggested function in environs/config and then it could be used in ...
12 years, 3 months ago (2013年10月02日 23:59:30 UTC) #5
You could put my suggested function in environs/config and then
it could be used in environs.ensureAdminSecret, making it three, if you like
:-)
On 3 October 2013 00:48, <fwereade@gmail.com> wrote:
> With some shame, I'm calling this two-strikes-not-three. It *will* be
> three when I get to landing a skeleton provider, though, and that's on
> its way.
>
> https://codereview.appspot.com/14307043/
Sign in to reply to this message.
mue
LGTM, only missing prefix "juju-" for "control-bucket". https://codereview.appspot.com/14307043/diff/1/provider/ec2/ec2.go File provider/ec2/ec2.go (right): https://codereview.appspot.com/14307043/diff/1/provider/ec2/ec2.go#newcode210 provider/ec2/ec2.go:210: attrs["control-bucket"] = ...
12 years, 3 months ago (2013年10月07日 08:15:38 UTC) #6
LGTM, only missing prefix "juju-" for "control-bucket".
https://codereview.appspot.com/14307043/diff/1/provider/ec2/ec2.go
File provider/ec2/ec2.go (right):
https://codereview.appspot.com/14307043/diff/1/provider/ec2/ec2.go#newcode210
provider/ec2/ec2.go:210: attrs["control-bucket"] = fmt.Sprintf("%x", uuid.Raw())
How about the prefix "juju-" here?
https://codereview.appspot.com/14307043/diff/1/provider/openstack/provider.go
File provider/openstack/provider.go (right):
https://codereview.appspot.com/14307043/diff/1/provider/openstack/provider.go...
provider/openstack/provider.go:133: attrs["control-bucket"] = fmt.Sprintf("%x",
uuid.Raw())
Same with prefix here. In BoilerplateConfig() we generate it with a prefix.
Sign in to reply to this message.
|
Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b

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