Merge lp:~thumper/juju-core/upgrade-fix-juju-run into lp:~go-bot/juju-core/trunk
Proposed by
Tim Penhey
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Tim Penhey | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 2419 | ||||
Proposed branch: | lp:~thumper/juju-core/upgrade-fix-juju-run | ||||
Merge into: | lp:~go-bot/juju-core/trunk | ||||
Diff against target: |
39 lines (+13/-0) 2 files modified
agent/tools/diskmanager_test.go (+6/-0) agent/tools/toolsdir.go (+7/-0) |
||||
To merge this branch: | bzr merge lp:~thumper/juju-core/upgrade-fix-juju-run | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+210951@code.launchpad.net |
Commit message
Fix the permissions on the tools dir on upgrade
The tempdir was created with 0700, and then renamed
to be the tools dir. Now we chmod to 0755 prior to
rename.
Description of the change
Fix the permissions on the tools dir on upgrade
The tempdir was created with 0700, and then renamed
to be the tools dir. Now we chmod to 0755 prior to
rename.
To post a comment you must log in.
Reviewers: mp+210951_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix the permissions on the tools dir on upgrade
The tempdir was created with 0700, and then renamed
to be the tools dir. Now we chmod to 0755 prior to
rename.
https:/ /code.launchpad .net/~thumper/ juju-core/ upgrade- fix-juju- run/+merge/ 210951
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/75680043/
Affected files (+15, -0 lines): diskmanager_ test.go toolsdir. go
A [revision details]
M agent/tools/
M agent/tools/
Index: [revision details] 20140313162936- 3e8iq4csv4axq6z 8
=== 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: agent/tools/ diskmanager_ test.go tools/diskmanag er_test. go' diskmanager_ test.go 2013-09-25 00:18:35 +0000 diskmanager_ test.go 2014-03-14 01:15:39 +0000
=== modified file 'agent/
--- agent/tools/
+++ agent/tools/
@@ -6,6 +6,7 @@
import (
"bytes"
"encoding/json"
+ "os"
"path/filepath"
gc "launchpad. net/gocheck" ReadTools( t.Version) *gotTools, gc.Equals, *t) info.Mode( ).Perm( ), gc.Equals, os.FileMode(0755))
@@ -101,4 +102,9 @@
gotTools, err := s.manager.
c.Assert(err, gc.IsNil)
c.Assert(
+ // Make sure that the tools directory is readable by the ubuntu user (for
+ // juju-run)
+ info, err := os.Stat(dir)
+ c.Assert(err, gc.IsNil)
+ c.Assert(
}
Index: agent/tools/ toolsdir. go tools/toolsdir. go' toolsdir. go 2014-02-03 14:31:54 +0000 toolsdir. go 2014-03-14 01:16:20 +0000
=== modified file 'agent/
--- agent/tools/
+++ agent/tools/
@@ -113,6 +113,13 @@
return err
}
+ // The tempdir is created with 0700, so we need to make it more dataDir, tools.Version))
+ // accessable for juju-run.
+ err = os.Chmod(dir, 0755)
+ if err != nil {
+ return err
+ }
+
err = os.Rename(dir, SharedToolsDir(
// If we've failed to rename the directory, it may be because
// the directory already exists - if ReadTools succeeds, we