Merge lp:~axwalk/juju-core/lp1235130-local-legacy-certs-take2 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: 1949
Proposed branch: lp:~axwalk/juju-core/lp1235130-local-legacy-certs-take2
Merge into: lp:~go-bot/juju-core/trunk
Diff against target: 43 lines (+0/-26)
1 file modified
provider/local/environ.go (+0/-26)
To merge this branch: bzr merge lp:~axwalk/juju-core/lp1235130-local-legacy-certs-take2
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+189235@code.launchpad.net

Commit message

provider/local: don't try to chown certs

Fixes #1235130

https://codereview.appspot.com/14289044/

Description of the change

provider/local: don't try to chown certs

Fixes #1235130

https://codereview.appspot.com/14289044/

To post a comment you must log in.
Revision history for this message
Andrew Wilkins (axwalk) wrote :

Reviewers: mp+189235_code.launchpad.net,

Message:
Please take a look.

Description:
provider/local: don't try to chown certs

Fixes #1235130

https://code.launchpad.net/~axwalk/juju-core/lp1235130-local-legacy-certs-take2/+merge/189235

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/14289044/

Affected files (+2, -26 lines):
   A [revision details]
   M provider/local/environ.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-20131003170932-4tkr0tu40wb0nfgl
+New revision: <email address hidden>

Index: provider/local/environ.go
=== modified file 'provider/local/environ.go'
--- provider/local/environ.go 2013-10-03 03:10:09 +0000
+++ provider/local/environ.go 2013-10-04 08:45:50 +0000
@@ -82,28 +82,6 @@
   return "juju-agent-" + env.config.namespace()
  }

-// ensureCertOwner checks to make sure that the cert files created
-// by the bootstrap command are owned by the user and not root.
-func (env *localEnviron) ensureCertOwner() error {
- files := []string{
- config.JujuHomePath(env.name + "-cert.pem"),
- config.JujuHomePath(env.name + "-private-key.pem"),
- }
-
- uid, gid, err := utils.SudoCallerIds()
- if err != nil {
- return err
- }
- if uid != 0 || gid != 0 {
- for _, filename := range files {
- if err := os.Chown(filename, uid, gid); err != nil {
- return err
- }
- }
- }
- return nil
-}
-
  // PrecheckInstance is specified in the environs.Prechecker interface.
  func (*localEnviron) PrecheckInstance(series string, cons
constraints.Value) error {
   return nil
@@ -126,10 +104,6 @@
    return err
   }

- if err := env.ensureCertOwner(); err != nil {
- logger.Errorf("failed to reassign ownership of the certs to the
user: %v", err)
- return err
- }
   // TODO(thumper): check that the constraints don't
include "container=lxc" for now.

   cert, key, err := env.setupLocalMongoService()

Revision history for this message
Roger Peppe (rogpeppe) wrote :

On 2013/10/04 08:48:49, axw wrote:
> Please take a look.

LGTM assuming you've verified live that it fixes the problem.

https://codereview.appspot.com/14289044/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'provider/local/environ.go'
2--- provider/local/environ.go 2013-10-03 03:10:09 +0000
3+++ provider/local/environ.go 2013-10-04 08:54:26 +0000
4@@ -82,28 +82,6 @@
5 return "juju-agent-" + env.config.namespace()
6 }
7
8-// ensureCertOwner checks to make sure that the cert files created
9-// by the bootstrap command are owned by the user and not root.
10-func (env *localEnviron) ensureCertOwner() error {
11- files := []string{
12- config.JujuHomePath(env.name + "-cert.pem"),
13- config.JujuHomePath(env.name + "-private-key.pem"),
14- }
15-
16- uid, gid, err := utils.SudoCallerIds()
17- if err != nil {
18- return err
19- }
20- if uid != 0 || gid != 0 {
21- for _, filename := range files {
22- if err := os.Chown(filename, uid, gid); err != nil {
23- return err
24- }
25- }
26- }
27- return nil
28-}
29-
30 // PrecheckInstance is specified in the environs.Prechecker interface.
31 func (*localEnviron) PrecheckInstance(series string, cons constraints.Value) error {
32 return nil
33@@ -126,10 +104,6 @@
34 return err
35 }
36
37- if err := env.ensureCertOwner(); err != nil {
38- logger.Errorf("failed to reassign ownership of the certs to the user: %v", err)
39- return err
40- }
41 // TODO(thumper): check that the constraints don't include "container=lxc" for now.
42
43 cert, key, err := env.setupLocalMongoService()

Subscribers

People subscribed via source and target branches

to status/vote changes: