Merge lp:~gz/juju-core/force_version_error into lp:~go-bot/juju-core/trunk
Proposed by
Martin Packman
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Martin Packman | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 1861 | ||||
Proposed branch: | lp:~gz/juju-core/force_version_error | ||||
Merge into: | lp:~go-bot/juju-core/trunk | ||||
Diff against target: |
17 lines (+3/-3) 1 file modified
version/version.go (+3/-3) |
||||
To merge this branch: | bzr merge lp:~gz/juju-core/force_version_error | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+186409@code.launchpad.net |
Commit message
version: report not panic on unreadable file
Change init() to not panic and instead report issues with
reading FORCE-VERSION to stderr.
https:/
R=themue
Description of the change
version: report not panic on unreadable file
Change init() to not panic and instead report issues with
reading FORCE-VERSION to stderr.
Unfortunately this seems pretty untestable, as we don't have
a framework for tests that actually need to run binaries.
To post a comment you must log in.
Reviewers: mp+186409_ code.launchpad. net,
Message:
Please take a look.
Description:
version: report not panic on unreadable file
Change init() to not panic and instead report issues with
reading FORCE-VERSION to stderr.
Unfortunately this seems pretty untestable, as we don't have
a framework for tests that actually need to run binaries.
https:/ /code.launchpad .net/~gz/ juju-core/ force_version_ error/+ merge/186409
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/13613045/
Affected files (+5, -3 lines):
A [revision details]
M version/version.go
Index: [revision details] 20130918141205- vzr0marfb2wzqj5 3
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: version/version.go version. go' Dir(os. Args[0] ) ReadFile( filepath. Join(toolsDir, "FORCE-VERSION")) os.Stderr, "WARNING: cannot read forced version: %v\n", err) Errorf( "version: cannot read forced version: %v", err)) strings. TrimSpace( string( v)))
=== modified file 'version/
--- version/version.go 2013-09-13 04:16:42 +0000
+++ version/version.go 2013-09-18 17:55:24 +0000
@@ -52,10 +52,10 @@
toolsDir := filepath.
v, err := ioutil.
if err != nil {
- if os.IsNotExist(err) {
- return
+ if !os.IsNotExist(err) {
+ fmt.Fprintf(
}
- panic(fmt.
+ return
}
Current.Number = MustParse(
}