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
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.

https://codereview.appspot.com/75680043/

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.

https://codereview.appspot.com/75680043/

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

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):
   A [revision details]
   M agent/tools/diskmanager_test.go
   M agent/tools/toolsdir.go

Index: [revision details]
=== 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-20140313162936-3e8iq4csv4axq6z8
+New revision: <email address hidden>

Index: agent/tools/diskmanager_test.go
=== modified file 'agent/tools/diskmanager_test.go'
--- agent/tools/diskmanager_test.go 2013-09-25 00:18:35 +0000
+++ agent/tools/diskmanager_test.go 2014-03-14 01:15:39 +0000
@@ -6,6 +6,7 @@
  import (
   "bytes"
   "encoding/json"
+ "os"
   "path/filepath"

   gc "launchpad.net/gocheck"
@@ -101,4 +102,9 @@
   gotTools, err := s.manager.ReadTools(t.Version)
   c.Assert(err, gc.IsNil)
   c.Assert(*gotTools, gc.Equals, *t)
+ // 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(info.Mode().Perm(), gc.Equals, os.FileMode(0755))
  }

Index: agent/tools/toolsdir.go
=== modified file 'agent/tools/toolsdir.go'
--- agent/tools/toolsdir.go 2014-02-03 14:31:54 +0000
+++ agent/tools/toolsdir.go 2014-03-14 01:16:20 +0000
@@ -113,6 +113,13 @@
    return err
   }

+ // The tempdir is created with 0700, so we need to make it more
+ // accessable for juju-run.
+ err = os.Chmod(dir, 0755)
+ if err != nil {
+ return err
+ }
+
   err = os.Rename(dir, SharedToolsDir(dataDir, tools.Version))
   // If we've failed to rename the directory, it may be because
   // the directory already exists - if ReadTools succeeds, we

Revision history for this message
Andrew Wilkins (axwalk) wrote :

On 2014/03/14 01:20:53, thumper wrote:
> Please take a look.

LGTM

https://codereview.appspot.com/75680043/

Revision history for this message
Go Bot (go-bot) wrote :
Download full text (35.4 KiB)

The attempt to merge lp:~thumper/juju-core/upgrade-fix-juju-run into lp:juju-core failed. Below is the output from the failed tests.

ok launchpad.net/juju-core 0.013s
ok launchpad.net/juju-core/agent 0.985s
ok launchpad.net/juju-core/agent/mongo 0.512s
ok launchpad.net/juju-core/agent/tools 0.185s
ok launchpad.net/juju-core/bzr 5.065s
ok launchpad.net/juju-core/cert 2.498s
ok launchpad.net/juju-core/charm 0.407s
? launchpad.net/juju-core/charm/hooks [no test files]
? launchpad.net/juju-core/charm/testing [no test files]
ok launchpad.net/juju-core/cloudinit 0.029s
ok launchpad.net/juju-core/cloudinit/sshinit 0.754s
ok launchpad.net/juju-core/cmd 0.210s
ok launchpad.net/juju-core/cmd/charm-admin 0.740s
? launchpad.net/juju-core/cmd/charmd [no test files]
? launchpad.net/juju-core/cmd/charmload [no test files]
ok launchpad.net/juju-core/cmd/juju 183.344s

----------------------------------------------------------------------
PANIC: agent.go:0: MachineSuite.SetUpTest

[LOG] 10.09424 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 10.09450 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 10.15597 INFO juju mongod: note: noprealloc may hurt performance in many applications
[LOG] 10.15601 INFO juju mongod: all output going to: /tmp/test-mgo425620099/server.log
[LOG] 10.59490 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 11.09521 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 11.59565 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 11.59573 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 12.09595 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 12.59626 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 13.09675 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 13.09683 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 13.59728 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 14.09767 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 14.59825 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 14.59841 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 15.09871 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 15.59912 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 16.09963 DEBUG juju.testing tls.Dial(127.0.0.1:33112) failed with dial tcp 127.0.0.1:33112: connection refused
[LOG] 16.09972 ...

Revision history for this message
Go Bot (go-bot) wrote :
Download full text (10.1 KiB)

The attempt to merge lp:~thumper/juju-core/upgrade-fix-juju-run into lp:juju-core failed. Below is the output from the failed tests.

ok launchpad.net/juju-core 0.014s
ok launchpad.net/juju-core/agent 1.020s
ok launchpad.net/juju-core/agent/mongo 0.520s
ok launchpad.net/juju-core/agent/tools 0.188s
ok launchpad.net/juju-core/bzr 5.402s
ok launchpad.net/juju-core/cert 2.298s
ok launchpad.net/juju-core/charm 0.429s
? launchpad.net/juju-core/charm/hooks [no test files]
? launchpad.net/juju-core/charm/testing [no test files]
ok launchpad.net/juju-core/cloudinit 0.029s
ok launchpad.net/juju-core/cloudinit/sshinit 0.788s
ok launchpad.net/juju-core/cmd 0.143s
ok launchpad.net/juju-core/cmd/charm-admin 0.727s
? launchpad.net/juju-core/cmd/charmd [no test files]
? launchpad.net/juju-core/cmd/charmload [no test files]
ok launchpad.net/juju-core/cmd/juju 184.162s
ok launchpad.net/juju-core/cmd/jujud 62.174s
ok launchpad.net/juju-core/cmd/plugins/juju-metadata 10.019s
? launchpad.net/juju-core/cmd/plugins/juju-restore [no test files]
ok launchpad.net/juju-core/cmd/plugins/local 0.156s
? launchpad.net/juju-core/cmd/plugins/local/juju-local [no test files]
ok launchpad.net/juju-core/constraints 0.022s
ok launchpad.net/juju-core/container 0.047s
ok launchpad.net/juju-core/container/factory 0.049s
ok launchpad.net/juju-core/container/kvm 0.210s
ok launchpad.net/juju-core/container/kvm/mock 0.043s
? launchpad.net/juju-core/container/kvm/testing [no test files]
ok launchpad.net/juju-core/container/lxc 4.344s
? launchpad.net/juju-core/container/lxc/mock [no test files]
? launchpad.net/juju-core/container/lxc/testing [no test files]
? launchpad.net/juju-core/container/testing [no test files]
ok launchpad.net/juju-core/downloader 5.225s
ok launchpad.net/juju-core/environs 2.230s
ok launchpad.net/juju-core/environs/bootstrap 3.208s
ok launchpad.net/juju-core/environs/cloudinit 0.478s
ok launchpad.net/juju-core/environs/config 1.745s
ok launchpad.net/juju-core/environs/configstore 0.031s
ok launchpad.net/juju-core/environs/filestorage 0.030s
ok launchpad.net/juju-core/environs/httpstorage 0.744s
ok launchpad.net/juju-core/environs/imagemetadata 0.433s
? launchpad.net/juju-core/environs/imagemetadata/testing [no test files]
ok launchpad.net/juju-core/environs/instances 0.043s
ok launchpad.net/juju-core/environs/jujutest 0.186s
ok launchpad.net/juju-core/environs/manual 11.372s
ok launchpad.net/juju-core/environs/simplestreams 0.286s
? launchpad.net/juju-core/environs/simplestreams/testing [no test files]
ok launchpad.net/juju-core/environs/sshstorage 0.981s
ok launchpad.net/juju-core/environs/storage 0.904s
ok launchpad.net/juju-core/environs/sync 43.415s
ok launchpad.net/juju-core/environs/testing 0.160s
ok launchpad.net/juju-core/environs/tools 4.674s
? launchpad.net/juju-core/environs/tools/testing [no test files]
ok launchpad.net/juju-core/errors 0.012s
ok launchpad.net/juju-core/instance 0.017s
? launchpad.net/juju-core/instance/testing [no test files]
ok launchpad.net/juju-core/juju 16.344s
ok launchpad.net/juju-core/juju/osenv 0.022s...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'agent/tools/diskmanager_test.go'
2--- agent/tools/diskmanager_test.go 2013-09-25 00:18:35 +0000
3+++ agent/tools/diskmanager_test.go 2014-03-14 01:19:34 +0000
4@@ -6,6 +6,7 @@
5 import (
6 "bytes"
7 "encoding/json"
8+ "os"
9 "path/filepath"
10
11 gc "launchpad.net/gocheck"
12@@ -101,4 +102,9 @@
13 gotTools, err := s.manager.ReadTools(t.Version)
14 c.Assert(err, gc.IsNil)
15 c.Assert(*gotTools, gc.Equals, *t)
16+ // Make sure that the tools directory is readable by the ubuntu user (for
17+ // juju-run)
18+ info, err := os.Stat(dir)
19+ c.Assert(err, gc.IsNil)
20+ c.Assert(info.Mode().Perm(), gc.Equals, os.FileMode(0755))
21 }
22
23=== modified file 'agent/tools/toolsdir.go'
24--- agent/tools/toolsdir.go 2014-02-03 14:31:54 +0000
25+++ agent/tools/toolsdir.go 2014-03-14 01:19:34 +0000
26@@ -113,6 +113,13 @@
27 return err
28 }
29
30+ // The tempdir is created with 0700, so we need to make it more
31+ // accessable for juju-run.
32+ err = os.Chmod(dir, 0755)
33+ if err != nil {
34+ return err
35+ }
36+
37 err = os.Rename(dir, SharedToolsDir(dataDir, tools.Version))
38 // If we've failed to rename the directory, it may be because
39 // the directory already exists - if ReadTools succeeds, we

Subscribers

People subscribed via source and target branches

to status/vote changes: