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

Issue 8566043: Fix ServiceDeploy panic when called via the API.

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years ago by frankban
Modified:
11 years ago
Reviewers:
mp+157836, rog, TheMue
Visibility:
Public.

Description

Fix ServiceDeploy panic when called via the API. Fix the panic that happens when calling ServiceDeploy via the juju-core API. Add a global charm.CacheDir variable, in order to avoid the call to config.JujuHomePath inside the CharmStore.Get method. charm.CacheDir is originally empty, and is then set by the machineAgent.Run method. Pre-implementation call with Roger. https://code.launchpad.net/~frankban/juju-core/bug-1166224-service-deploy-panic/+merge/157836 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 6

Patch Set 2 : Fix ServiceDeploy panic when called via the API. #

Total comments: 6

Patch Set 3 : Fix ServiceDeploy panic when called via the API. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -31 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M charm/repo.go View 1 2 4 chunks +11 lines, -5 lines 0 comments Download
M charm/repo_test.go View 1 2 3 chunks +6 lines, -6 lines 0 comments Download
M cmd/juju/main.go View 1 2 2 chunks +5 lines, -19 lines 0 comments Download
M cmd/jujud/machine.go View 3 chunks +3 lines, -0 lines 0 comments Download
M cmd/jujud/machine_test.go View 1 4 chunks +13 lines, -1 line 0 comments Download
M juju/conn.go View 1 2 2 chunks +19 lines, -0 lines 0 comments Download
M juju/conn_test.go View 1 2 chunks +48 lines, -0 lines 0 comments Download

Messages

Total messages: 7
frankban
Please take a look.
11 years ago (2013-04-09 10:06:32 UTC) #1
rog
not lgtm for the moment - the CharmDir is not set when the juju command ...
11 years ago (2013-04-09 11:24:13 UTC) #2
TheMue
LGTM
11 years ago (2013-04-09 11:25:39 UTC) #3
TheMue
On 2013/04/09 11:24:13, rog wrote: > not lgtm for the moment - the CharmDir is ...
11 years ago (2013-04-09 11:30:07 UTC) #4
frankban
Please take a look. https://codereview.appspot.com/8566043/diff/1/charm/repo.go File charm/repo.go (right): https://codereview.appspot.com/8566043/diff/1/charm/repo.go#newcode214 charm/repo.go:214: // Get returns the charm ...
11 years ago (2013-04-09 15:51:50 UTC) #5
rog
LGTM with the below points addressed. thanks! https://codereview.appspot.com/8566043/diff/7001/cmd/juju/main.go File cmd/juju/main.go (right): https://codereview.appspot.com/8566043/diff/7001/cmd/juju/main.go#newcode30 cmd/juju/main.go:30: fmt.Fprintf(os.Stderr, "command ...
11 years ago (2013-04-09 16:22:59 UTC) #6
frankban
11 years ago (2013-04-09 16:43:23 UTC) #7
*** Submitted:

Fix ServiceDeploy panic when called via the API.

Fix the panic that happens when calling ServiceDeploy via the juju-core API.

Add a global charm.CacheDir variable, in order to avoid the call to
config.JujuHomePath inside the CharmStore.Get method.

charm.CacheDir is originally empty, and is then set by the machineAgent.Run
method.

Pre-implementation call with Roger.

R=rog, TheMue
CC=
https://codereview.appspot.com/8566043

https://codereview.appspot.com/8566043/diff/7001/cmd/juju/main.go
File cmd/juju/main.go (right):

https://codereview.appspot.com/8566043/diff/7001/cmd/juju/main.go#newcode30
cmd/juju/main.go:30: fmt.Fprintf(os.Stderr, "command failed: "+err.Error()+"\n")
On 2013/04/09 16:22:59, rog wrote:
> fmt.Fprintf(os.Stderr, "error: %s\n", err)
> 
> to be consistent with cmd.Main
> 
> in general passing a non-constant argument to Fprintf-like functions is not a
> good idea regardless.

Done.

https://codereview.appspot.com/8566043/diff/7001/cmd/juju/main.go#newcode31
cmd/juju/main.go:31: os.Exit(1)
On 2013/04/09 16:22:59, rog wrote:
> i know it was like this before, but i think this should probably be
os.Exit(2).

Done.

https://codereview.appspot.com/8566043/diff/7001/juju/conn.go
File juju/conn.go (right):

https://codereview.appspot.com/8566043/diff/7001/juju/conn.go#newcode413
juju/conn.go:413: // It also sets up the charm cache directory path in
charm.CacheDir.
On 2013/04/09 16:22:59, rog wrote:
> // InitJujuHome initializes the charm and environs/config
> // packages to use default paths based on the
> // $JUJU_HOME or $HOME environment variables.
> // This function should be called before calling NewConn or
> // Conn.Deploy.
> 
> ?

Done.
Sign in to reply to this message.

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