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

Issue 8067044: Better error when region is misconfigured. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by wallyworld
Modified:
11 years, 1 month ago
Reviewers:
dimitern, mp+155889, jameinel
Visibility:
Public.

Description

Better error when region is misconfigured. This branch prints a better error message if the user hasn't configured their region correctly. For example, if they specify the swift region, but not the fully qualified compute region, they are told that and the list of correct regions is displayed. Similarly, if the region is totally wrong, they are told that too. The nexted error have also been reformatted to make them more readable, eg error: failed to GET object provider-state from container juju-50548874395ac32d8896f65ab33f3e17 caused by: cannot create service URLs caused by: invalid region "xegion-a.geo-1" one of these regions may be suitable instead: "az-1.region-a.geo-1, az-2.region-a.geo-1, az-3.region-a.geo-1" https://code.launchpad.net/~wallyworld/goose/better-misconfig-error/+merge/155889 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 14

Patch Set 2 : Better error when region is misconfigured. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+215 lines, -17 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M client/client.go View 1 7 chunks +134 lines, -10 lines 2 comments Download
M client/live_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M client/local_test.go View 1 5 chunks +73 lines, -1 line 0 comments Download
M errors/errors.go View 1 1 chunk +1 line, -1 line 0 comments Download
M errors/errors_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M nova/local_test.go View 1 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 8
wallyworld
Please take a look.
11 years, 1 month ago (2013-03-28 05:09:31 UTC) #1
jameinel
LGTM This is the new error message: $ ./juju bootstrap -e hp-jam error: cannot query ...
11 years, 1 month ago (2013-03-28 06:39:43 UTC) #2
dimitern
Somewhat tentative LGTM, although I'd suggest a bit of refactoring the deeply nested for loops ...
11 years, 1 month ago (2013-03-28 08:23:39 UTC) #3
wallyworld
Please take a look.
11 years, 1 month ago (2013-03-28 09:07:55 UTC) #4
jameinel
LGTM https://codereview.appspot.com/8067044/diff/8001/client/client.go File client/client.go (right): https://codereview.appspot.com/8067044/diff/8001/client/client.go#newcode212 client/client.go:212: "access to these services is missing: %q", This ...
11 years, 1 month ago (2013-03-28 09:44:27 UTC) #5
wallyworld
https://codereview.appspot.com/8067044/diff/8001/client/client.go File client/client.go (right): https://codereview.appspot.com/8067044/diff/8001/client/client.go#newcode212 client/client.go:212: "access to these services is missing: %q", On 2013/03/28 ...
11 years, 1 month ago (2013-03-28 09:50:34 UTC) #6
dimitern
So you basically ignored all my suggestions and didn't even reply..
11 years, 1 month ago (2013-03-28 10:22:24 UTC) #7
wallyworld
11 years, 1 month ago (2013-03-28 12:39:25 UTC) #8
Sorry, I totally missed doing these suggestions. I've made the fixes in branch
lp:~wallyworld/goose/region-error-fixups

https://codereview.appspot.com/8067044/diff/1/client/client.go
File client/client.go (right):

https://codereview.appspot.com/8067044/diff/1/client/client.go#newcode73
client/client.go:73: // The service types which must be available after
authentication,
On 2013/03/28 08:23:39, dimitern wrote:
> put a line break between this and previous lines please.

Done.

https://codereview.appspot.com/8067044/diff/1/client/client.go#newcode211
client/client.go:211: errorPrefix = fmt.Sprintf("the configured region %q does
not allow access to all required services, namely: %q, "+
On 2013/03/28 08:23:39, dimitern wrote:
> %q -> %s ("x", "y") - see below.

Done.

https://codereview.appspot.com/8067044/diff/1/client/client.go#newcode212
client/client.go:212: "access to these services is missing: %q",
On 2013/03/28 08:23:39, dimitern wrote:
> ditto

Done.

https://codereview.appspot.com/8067044/diff/1/client/client.go#newcode219
client/client.go:219: return fmt.Errorf("%s, one of these regions may be
suitable instead: %q",
On 2013/03/28 08:23:39, dimitern wrote:
> instead of %q here, it's better to print out %s, which has each region name
> enclosed in quotes, like:
> "region1", "region2", "region3"
> instead:
> "region1, region2, region3"
> otherwise the user might try to use the comma-delimited list of regions as
> region name in the config.

Done.

https://codereview.appspot.com/8067044/diff/1/client/client.go#newcode230
client/client.go:230: // possibleRegions returns a list of regions, any of which
will allow the client to access the required service types.
On 2013/03/28 08:23:39, dimitern wrote:
> please use some line breaks to separate logical parts of the code here, it's a
> bit hard to read like this.
> 
>  in addition, I think it's better to extract some bits of the deeply nested
> loops as helpers outside, to reduce the nestiness depth.

Done.

https://codereview.appspot.com/8067044/diff/1/client/local_test.go
File client/local_test.go (right):

https://codereview.appspot.com/8067044/diff/1/client/local_test.go#newcode284
client/local_test.go:284: var missingEndpointMsgf = ".*the configured region %q
does not allow access to all required services, namely: %q, access to these
services is missing: %q"
On 2013/03/28 08:23:39, dimitern wrote:
> same points on %q vs. %s ("x", "y") in messages

Done.

https://codereview.appspot.com/8067044/diff/1/client/local_test.go#newcode321
client/local_test.go:321: c.Assert(err.Error(), Matches, at.errorMsg)
On 2013/03/28 08:23:39, dimitern wrote:
> why not c.Assert(err, ErrorMatches, at.errorMsg) ?

Done.
Sign in to reply to this message.

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