Merge lp:~thumper/juju-core/fix-lxc-destroy 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: 1492
Proposed branch: lp:~thumper/juju-core/fix-lxc-destroy
Merge into: lp:~go-bot/juju-core/trunk
Diff against target: 33 lines (+1/-7)
2 files modified
container/lxc/lxc.go (+1/-5)
container/lxc/lxc_test.go (+0/-2)
To merge this branch: bzr merge lp:~thumper/juju-core/fix-lxc-destroy
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+175694@code.launchpad.net

Commit message

Fix local provider destroy environment.

lxc-destroy removes the restart symlink, so we don't have to.
Right now we are failing because we can't remove it.

https://codereview.appspot.com/11546043/

Description of the change

Fix local provider destroy environment.

lxc-destroy removes the restart symlink, so we don't have to.
Right now we are failing because we can't remove it.

https://codereview.appspot.com/11546043/

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

Reviewers: mp+175694_code.launchpad.net,

Message:
Please take a look.

Description:
Fix local provider destroy environment.

lxc-destroy removes the restart symlink, so we don't have to.
Right now we are failing because we can't remove it.

https://code.launchpad.net/~thumper/juju-core/fix-lxc-destroy/+merge/175694

(do not edit description out of merge proposal)

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

Affected files:
   A [revision details]
   M container/lxc/lxc.go
   M container/lxc/lxc_test.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-20130718173319-vlhw6iu5usihaazp
+New revision: <email address hidden>

Index: container/lxc/lxc.go
=== modified file 'container/lxc/lxc.go'
--- container/lxc/lxc.go 2013-07-18 02:55:17 +0000
+++ container/lxc/lxc.go 2013-07-18 21:43:30 +0000
@@ -157,15 +157,11 @@
    logger.Errorf("failed to stop lxc container: %v", err)
    return err
   }
+ // Destroy removes the restart symlink for us.
   if err := container.Destroy(); err != nil {
    logger.Errorf("failed to destroy lxc container: %v", err)
    return err
   }
- // Remove the autostart symlink
- if err := os.Remove(restartSymlink(name)); err != nil {
- return err
- }
- logger.Tracef("auto-restart link removed")

   // Move the directory.
   logger.Tracef("create old container dir: %s", removedContainerDir)

Index: container/lxc/lxc_test.go
=== modified file 'container/lxc/lxc_test.go'
--- container/lxc/lxc_test.go 2013-07-17 23:38:15 +0000
+++ container/lxc/lxc_test.go 2013-07-18 21:43:30 +0000
@@ -122,8 +122,6 @@
   c.Assert(filepath.Join(s.ContainerDir, name), jc.DoesNotExist)
   // but instead, in the removed container dir
   c.Assert(filepath.Join(s.RemovedDir, name), jc.IsDirectory)
- // Check that the restart link has been removed.
- c.Assert(filepath.Join(s.RestartDir, name+".conf"), jc.DoesNotExist)
  }

  func (s *LxcSuite) TestStopContainerNameClash(c *gc.C) {

Revision history for this message
Ian Booth (wallyworld) wrote :
Revision history for this message
Dimiter Naydenov (dimitern) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'container/lxc/lxc.go'
2--- container/lxc/lxc.go 2013-07-18 02:55:17 +0000
3+++ container/lxc/lxc.go 2013-07-18 21:45:36 +0000
4@@ -157,15 +157,11 @@
5 logger.Errorf("failed to stop lxc container: %v", err)
6 return err
7 }
8+ // Destroy removes the restart symlink for us.
9 if err := container.Destroy(); err != nil {
10 logger.Errorf("failed to destroy lxc container: %v", err)
11 return err
12 }
13- // Remove the autostart symlink
14- if err := os.Remove(restartSymlink(name)); err != nil {
15- return err
16- }
17- logger.Tracef("auto-restart link removed")
18
19 // Move the directory.
20 logger.Tracef("create old container dir: %s", removedContainerDir)
21
22=== modified file 'container/lxc/lxc_test.go'
23--- container/lxc/lxc_test.go 2013-07-17 23:38:15 +0000
24+++ container/lxc/lxc_test.go 2013-07-18 21:45:36 +0000
25@@ -122,8 +122,6 @@
26 c.Assert(filepath.Join(s.ContainerDir, name), jc.DoesNotExist)
27 // but instead, in the removed container dir
28 c.Assert(filepath.Join(s.RemovedDir, name), jc.IsDirectory)
29- // Check that the restart link has been removed.
30- c.Assert(filepath.Join(s.RestartDir, name+".conf"), jc.DoesNotExist)
31 }
32
33 func (s *LxcSuite) TestStopContainerNameClash(c *gc.C) {

Subscribers

People subscribed via source and target branches

to status/vote changes: