Merge lp:~waigani/juju-core/lxc-autorestart-setting into lp:~go-bot/juju-core/trunk
Proposed by
Jesse Meek
Status: | Work in progress |
---|---|
Proposed branch: | lp:~waigani/juju-core/lxc-autorestart-setting |
Merge into: | lp:~go-bot/juju-core/trunk |
Prerequisite: | lp:~waigani/juju-core/managers-should-warn-for-any-unknown-options |
Diff against target: |
148 lines (+60/-5) 4 files modified
container/lxc/lxc.go (+15/-2) container/lxc/lxc_test.go (+39/-3) provider/local/config.go (+5/-0) provider/local/environ.go (+1/-0) |
To merge this branch: | bzr merge lp:~waigani/juju-core/lxc-autorestart-setting |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+210117@code.launchpad.net |
Description of the change
LXC AutoRestart Setting
lxc.containerMa
and sets that from container.
not in container.
default is true.
To post a comment you must log in.
Unmerged revisions
- 2403. By Jesse Meek
-
merged trunk
- 2402. By Jesse Meek
-
added tests
- 2401. By Jesse Meek
-
merged trunk
- 2400. By Jesse Meek
-
cosmetic change to if statement syntax
- 2399. By Jesse Meek
-
LXC AutoRestart Setting
lxc.containerMa
nager gains “autorestart bool”,
and sets that from container.ManagerConfig, if
not in container.ManagerConfig, then manager
default is true.
Reviewers: mp+210117_ code.launchpad. net,
Message:
Please take a look.
Description:
LXC AutoRestart Setting
lxc.containerMa nager gains "autorestart bool", ManagerConfig, if ManagerConfig, then manager
and sets that from container.
not in container.
default is true.
https:/ /code.launchpad .net/~waigani/ juju-core/ lxc-autorestart -setting/ +merge/ 210117
Requires: /code.launchpad .net/~waigani/ juju-core/ managers- should- warn-for- any-unknown- options/ +merge/ 210114
https:/
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/73390043/
Affected files (+26, -3 lines): lxc/lxc. go lxc/lxc_ test.go
A [revision details]
M container/
M container/
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: <email address hidden>
+New revision: <email address hidden>
Index: container/ lxc/lxc. go lxc/lxc. go' lxc/lxc. go 2014-03-10 02:51:31 +0000 lxc/lxc. go 2014-03-10 03:33:38 +0000
=== modified file 'container/
--- container/
+++ container/
@@ -42,8 +42,9 @@
}
type containerManager struct {
- name string
- logdir string
+ name string
+ logdir string
+ autorestart bool
}
// containerManager implements container.Manager. Warningf( `Found unused config option with key: "%v" and
@@ -63,11 +64,21 @@
if logDir == "" {
logDir = agent.DefaultLogDir
}
+ autoRestart := false
+ if conf["autoRestart"] == "" || conf["autoRestart"] == "true" {
+ autoRestart = true
+ }
+ delete(conf, "autoRestart")
+
for k, v := range conf {
logger.
value: "%v"`, k, v)
}
- return &containerManag er{name: name, logdir: logDir}, nil er{name: name, logdir: logDir, autorestart:
+ return &containerManag
autoRestart}, nil
+}
+
+func (manager *containerManager) AutoRestart() bool {
+ return manager.autorestart
}
func (manager *containerManager) StartContainer(
Index: container/ lxc/lxc_ test.go lxc/lxc_ test.go' lxc/lxc_ test.go 2014-03-10 02:51:31 +0000 lxc/lxc_ test.go 2014-03-10 03:33:38 +0000 c.GetTestLog( ), gc.Matches, `^.*WARNING juju.container.lxc Found
=== modified file 'container/
--- container/
+++ container/
@@ -58,6 +58,16 @@
c.Assert(
unused config option with key: "shazam" and value: "Captain Marvel"\n*`)
}
+func (*LxcSuite) TestAutoRestart DefaultTrue( c *gc.C) { rManager( container. ManagerConfig{ ConfigName: "startMeUp", manager. somehowGetAutoR estart( ?), gc.Equals, true) ner(c *gc.C) { g.StartContaine r(c, manager, "1/lxc/0")
+ _, err := lxc.NewContaine
+ container.
+ })
+ c.Assert(err, gc.IsNil)
+
+ // How do we test autorestart ?
+ // c.Assert(
+}
+
func (s *LxcSuite) TestStartContai
manager := s.makeManager(c, "test")
instance := containertestin