2728
|
|
|
John Arbash Meinel |
10 years ago
|
|
|
2727
|
|
|
John Arbash Meinel |
10 years ago
|
|
|
2720
|
|
|
John Arbash Meinel |
10 years ago
|
|
|
2674
|
|
|
Andrew Wilkins |
10 years ago
|
|
|
2666
|
|
|
Andrew Wilkins |
10 years ago
|
|
|
2659
|
|
|
Ian Booth |
10 years ago
|
|
|
2648
|
|
[r=dimitern] errors: Improve tests, unify interfaces, wrapping
The errors package is refactored so that for all errors defined there are 3 functions with consistent names: * Is<type>(error) bool Returns true if the error satifies <type> (i.e. it was created with one of the two constructors below for <type>. * New<type>(error, string) error Creates an error of <type> wrapping the given error and adding the prefix to the message. * <type>f(string, ...interface{}) error Creates an error of <type> with a message, formatted like fmt.Sprintf.
Dropped "Error" from type and function names (as they already are in the "errors" package). Moved utils.ErrorContextf in here, renaming it to Maskf. A new helper called Contextf is added, which works similarly to Maskf, but preserves the original error when wrapping (if it's one of the known types), so that the Is<type>() satifiers will work on the wrapped error as well.
Added automatic exhaustive testing for each error type in a way that makes it easier to add new types.
Few drive-by fixes made while fixing the rest of the code base to use the new function names.
I realize we should use errgo for such things, but we can easily change the errors package to use errgo internally later.
https://codereview.appspot.com/87560043/
R=rogpeppe
|
Dimiter Naydenov |
10 years ago
|
|
|
2595
|
|
|
Curtis Hovey |
10 years ago
|
|
|
2577
|
|
|
Dimiter Naydenov |
10 years ago
|
|
|
2559
|
|
|
Casey Marshall |
10 years ago
|
|
|
2551
|
|
|
Andrew Wilkins |
10 years ago
|
|
|
2540
|
|
|
Dimiter Naydenov |
10 years ago
|
|
|
2477
|
|
|
Martin Packman |
10 years ago
|
|
|
2470
|
|
|
Casey Marshall |
10 years ago
|
|
|
2418
|
|
|
Andrew Wilkins |
10 years ago
|
|
|
2413
|
|
|
Jesse Meek |
10 years ago
|
|
|
2409
|
|
[r=dimitern],[bug=1221134] various: production code and logging improvements
Fixed 4 slightly annoying, unrelated minor issues: 1. Refactored production code not to depend on gocheck (manual provider and apiserver/charms). As a drive-by fix, I refactored environs/manual tests to be proper black-box unit tests, rather than white-box tests in the manual package. 2. Fixed and improved tools download output via curl and better handling of errors. 3. Added debug logging to environs sshstorage and httpstorage, and the manual provider. 4. Reformatted and unified generated boilerplate config across all providers, fixing bug #1221134 in the process (-e env not properly explained).
Changes tested live with a manual and local environs with added manually provisioned machines.
While testing I found out and filed this bug #1291292 (basically manual bootstrap is broken with ssl-hostname- verification set to false, but this is due to a deeper issue).
I tried to unify and fix when all commands report "environment not bootstrapped", consistently across providers, but it turned out like more work than I originally thought, so I'll do a follow-up on that (which will entail dropping support for 1.14 environments without a .jenv file).
https://codereview.appspot.com/72860045/
R=jameinel, rogpeppe
|
Dimiter Naydenov |
10 years ago
|
|
|
2344
|
|
|
Andrew Wilkins |
10 years ago
|
|
|
2335
|
|
|
Andrew Wilkins |
10 years ago
|
|
|
2187
|
|
|
John Arbash Meinel |
10 years ago
|
|
|