Merge lp:~fwereade/pyjuju/go-cmd-server-package into lp:pyjuju/go
Status: | Work in progress |
---|---|
Proposed branch: | lp:~fwereade/pyjuju/go-cmd-server-package |
Merge into: | lp:pyjuju/go |
Prerequisite: | lp:~fwereade/pyjuju/go-tweak-supercommand |
Diff against target: |
306 lines (+296/-0) 2 files modified
cmd/server/server.go (+144/-0) cmd/server/server_test.go (+152/-0) |
To merge this branch: | bzr merge lp:~fwereade/pyjuju/go-cmd-server-package |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+96140@code.launchpad.net |
Description of the change
Add cmd/server package to enable hosted Command execution via RPC
prereq: lp:~fwereade/juju/go-tweak-supercommand
This is all new code, and shouldn't impact anything else, so it should be
adequately explained by the inline comments (and if it isn't, those should
be fixed). Nonetheless, the general idea is as follows:
1) Hook commands need to run the "meat" of their code on the server.
2) The python implementation includes an awful lot of plumbing to support a
mechanism whereby each individual command marshals relevant params to a
server and gets back results which are then formatted for stdout; in
juju.hooks, the cli, commands, and protocol modules all contain a lot of
code purely to support this approach.
3) By implementing a single server method that takes a command line, a
working directory, and a context ID; and returns an exit code and the
command's output: at a stroke, we eliminate the vast majority of the
marshalling busywork, and become able to implement each hook tool as a
single Command, which can have direct access to the hook context in which
it will execute.
Unmerged revisions
- 88. By William Reade
-
merge parent
- 87. By William Reade
-
merge parent
- 86. By William Reade
-
merge parent
- 85. By William Reade
-
fix param names
- 84. By William Reade
-
client id became context id
- 83. By William Reade
-
add cmd/server package
- 82. By William Reade
-
anticipatory SuperCommand tweaks
Reviewers: mp+96140_ code.launchpad. net,
Message:
Please take a look.
Description:
prereq: lp:~fwereade/juju/go-tweak-supercommand
This is all new code, and shouldn't impact anything else, so it should
be
adequately explained by the inline comments (and if it isn't, those
should
be fixed).
https:/ /code.launchpad .net/~fwereade/ juju/go- cmd-server- package/ +merge/ 96140
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/5754052/
Affected files: bootstrap. go main_test. go machine. go main_test. go provisioning. go server. go server_ test.go d_test. go
M cmd/command.go
A cmd/context.go
A cmd/context_test.go
M cmd/juju/
M cmd/juju/
M cmd/jujud/initzk.go
M cmd/jujud/
M cmd/jujud/
M cmd/jujud/
M cmd/jujud/unit.go
A cmd/server/
A cmd/server/
M cmd/supercommand.go
M cmd/supercomman