Merge lp://staging/~rogpeppe/juju-core/312-api-jobs into lp://staging/~juju/juju-core/trunk
Proposed by
Roger Peppe
Status: | Rejected |
---|---|
Rejected by: | William Reade |
Proposed branch: | lp://staging/~rogpeppe/juju-core/312-api-jobs |
Merge into: | lp://staging/~juju/juju-core/trunk |
Prerequisite: | lp://staging/~rogpeppe/juju-core/311-juju-bootstrap-state-change-password-1.5 |
Diff against target: |
1654 lines (+1071/-213) 21 files modified
cmd/jujud/bootstrap.go (+1/-1) cmd/jujud/bootstrap_test.go (+1/-1) cmd/jujud/machine.go (+2/-2) cmd/jujud/machine_test.go (+4/-4) environs/config/config_test.go (+1/-1) environs/dummy/environs.go (+0/-3) juju/testing/repo.go (+0/-1) state/api/params/params.go (+30/-0) state/apiserver/admin.go (+0/-20) state/apiserver/apiserver.go (+750/-0) state/apiserver/common/interfaces.go (+1/-1) state/apiserver/login_test.go (+4/-3) state/apiserver/machine/agent.go (+69/-0) state/apiserver/machine/agent_test.go (+91/-0) state/apiserver/machine/common_test.go (+66/-0) state/apiserver/machine/machiner.go (+12/-12) state/apiserver/machine/machiner_test.go (+9/-61) state/apiserver/resource.go (+0/-82) state/apiserver/root.go (+22/-13) state/machine.go (+6/-6) state/state_test.go (+2/-2) |
To merge this branch: | bzr merge lp://staging/~rogpeppe/juju-core/312-api-jobs |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+165705@code.staging.launchpad.net |
Description of the change
api: implement Machine.Jobs
To post a comment you must log in.
Unmerged revisions
- 1244. By Roger Peppe
-
merge 321-apiserver-
machineagent- api - 1243. By Roger Peppe
-
merge 311-juju-
bootstrap- state-change- password- 1.5 - 1242. By Roger Peppe
-
revert all jobs changes
- 1241. By Roger Peppe
-
gofmt
- 1240. By Roger Peppe
-
all: rename JobServeAPI to JobManageState
- 1239. By Roger Peppe
-
Merged 311-juju-
bootstrap- state-change- password- 1.5 into 312-api-jobs. - 1238. By Roger Peppe
-
api: implement Machine.Jobs
- 1237. By Roger Peppe
-
merge trunk
- 1236. By Roger Peppe
-
cmd/juju: revert bogus change
- 1235. By Roger Peppe
-
cmd/jujud: change password for machine agent
Reviewers: mp+165705_ code.launchpad. net,
Message:
Please take a look.
Description:
api: implement Machine.Jobs
https:/ /code.launchpad .net/~rogpeppe/ juju-core/ 312-api- jobs/+merge/ 165705
Requires: /code.launchpad .net/~rogpeppe/ juju-core/ 311-juju- bootstrap- state-change- password- 1.5/+merge/ 165675
https:/
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/9754043/
Affected files: machine. go params/ params. go /machine_ test.go /utils. go
A [revision details]
M state/api/
M state/api/
M state/apiserver
M state/apiserver
M state/machine.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: <email address hidden>
+New revision: <email address hidden>
Index: state/machine.go
=== modified file 'state/machine.go'
--- state/machine.go 2013-05-21 16:40:29 +0000
+++ state/machine.go 2013-05-24 21:38:13 +0000
@@ -36,7 +36,7 @@
JobServeAPI
)
-var jobNames = []string{ MachineJob{ iron: "JobManageEnviron", "<unknown job %d>", j)
+var jobNames = []params.
JobHostUnits: "JobHostUnits",
JobManageEnv
JobServeAPI: "JobServeAPI",
@@ -47,7 +47,7 @@
if j <= 0 || j >= len(jobNames) {
return fmt.Sprintf(
}
- return jobNames[j]
+ return string(jobNames[j])
}
// machineDoc represents the internal state of a machine in MongoDB.
Index: state/api/ machine. go api/machine. go' machine. go 2013-05-24 19:03:39 +0000 machine. go 2013-05-24 21:38:13 +0000
=== modified file 'state/
--- state/api/
+++ state/api/
@@ -139,6 +139,11 @@
return m.doc.Life
}
+// Jobs returns the responsibilities that must be fulfilled by m's agent.
+func (m *Machine) Jobs() []params.MachineJob {
+ return m.doc.Jobs
+}
+
// Series returns the operating system series running on the machine.
func (m *Machine) Series() string {
return m.doc.Series
Index: state/apiserver /machine_ test.go apiserver/ machine_ test.go' /machine_ test.go 2013-05-24 19:03:39 +0000 /machine_ test.go 2013-05-24 21:38:13 +0000 string( life), Equals, "dead")
=== modified file 'state/
--- state/apiserver
+++ state/apiserver
@@ -212,6 +212,29 @@
c.Assert(
}
+func (s *suite) TestMachineJobs(c *C) { Environ, ord(c, stm) stm.Id( )) MachineJob{ JobHostUnits, JobManageEnviro n, reDead( c *C) { AddMachine( "series" , state.JobHostUnits)
+ stm, err := s.State.AddMachine(
+ "series",
+ state.JobHostUnits,
+ state.JobManage
+ state.JobServeAPI,
+ )
+ c.Assert(err, IsNil)
+ setDefaultPassw
+
+ st := s.openAs(c, stm.Tag())
+ defer st.Close()
+
+ m, err := st.Machine(
+ c.Assert(err, IsNil)
+
+ c.Assert(m.Jobs(), DeepEquals, []params.
+ params.
+ params.
+ params.JobServeAPI,
+ })
+}
+
func (s *suite) TestMachineEnsu
stm, err := s.State.
c.Assert(err, IsNil)
Index: state/apiserver /utils. go apiserver/ utils.go' /utils. go 2013-05-24 19:11:19 +0000 /utils. go 2013-05-24 21:38:13 +0000
=== modified file 'state/
--- state/apiserver
+++ state/apiserver
@@ -44,10 +44,16 @@
return nil
}
instId, _ := stm.InstanceId()
+ jobs := stm....