Merge lp:~axwalk/juju-core/local-provider-fixes into lp:~go-bot/juju-core/trunk
Proposed by
Andrew Wilkins
Status: | Merged |
---|---|
Approved by: | Andrew Wilkins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2253 |
Proposed branch: | lp:~axwalk/juju-core/local-provider-fixes |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
41 lines (+5/-4) 3 files modified
provider/local/config.go (+1/-2) provider/local/environ.go (+3/-1) provider/local/environprovider.go (+1/-1) |
To merge this branch: | bzr merge lp:~axwalk/juju-core/local-provider-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+202973@code.launchpad.net |
Commit message
provider/local: fix namespace, destroy
There was an error in the namespace attribute check.
We must check that it is either "" or nil.
When Destroy() is called, it calls the CLI again with sudo.
We must pass -y to prevent juju from prompting the user.
Description of the change
provider/local: fix namespace, destroy
There was an error in the namespace attribute check.
We must check that it is either "" or nil.
When Destroy() is called, it calls the CLI again with sudo.
We must pass -y to prevent juju from prompting the user.
To post a comment you must log in.
Reviewers: mp+202973_ code.launchpad. net,
Message:
Please take a look.
Description:
provider/local: fix namespace, destroy
There was an error in the namespace attribute check.
We must check that it is either "" or nil.
When Destroy() is called, it calls the CLI again with sudo.
We must pass -y to prevent juju from prompting the user.
https:/ /code.launchpad .net/~axwalk/ juju-core/ local-provider- fixes/+ merge/202973
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/56260044/
Affected files (+6, -2 lines): local/environ. go local/environpr ovider. go
A [revision details]
M provider/
M provider/
Index: [revision details] 20140124005805- 5wkfrpv3q7zaknx v
=== 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: provider/ local/environ. go local/environ. go' local/environ. go 2014-01-23 21:20:27 +0000 local/environ. go 2014-01-24 01:27:26 +0000 "sudo", append( []string{ juju}, os.Args[1:]...)...) []string{ juju}, os.Args[1:]...) "sudo", args...)
=== modified file 'provider/
--- provider/
+++ provider/
@@ -405,7 +405,9 @@
if err != nil {
return err
}
- cmd := exec.Command(
+ args := append(
+ args = append(args, "-y")
+ cmd := exec.Command(
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
Index: provider/ local/environpr ovider. go local/environpr ovider. go' local/environpr ovider. go 2014-01-23 05:45:58 +0000 local/environpr ovider. go 2014-01-24 01:27:26 +0000 s()["namespace" ]; namespace == "" { s()["namespace" ].(string) ; namespace "%s-%s" , os.Getenv("USER"), cfg.Name()) map[string] interface{ }{"namespace" : namespace})
=== modified file 'provider/
--- provider/
+++ provider/
@@ -47,7 +47,7 @@
// Set the "namespace" attribute. We do this here, and not in Prepare,
// for backwards compatibility: older versions did not store the namespace
// in config.
- if namespace := cfg.UnknownAttr
+ if namespace, _ := cfg.UnknownAttr
== "" {
var err error
namespace = fmt.Sprintf(
cfg, err = cfg.Apply(