~rogpeppe/juju-core/438-local-instance-Addresses

« back to all changes in this revision

Viewing changes to cmd/jujud/agent.go

[r=fwereade],[bug=1234035] Fix upgrade 1.14 -> 1.15

This adds a Tools() API call to provisioner API,
similarly to the upgrader API. Common code factored
out into apiserver/common/tools.go.

SetAgentTools() renamed to SetAgentVersion() in
machine and unit state types. Also renamed a few
types in params to be shorter or better reflect
what are they about. Added DEPRECATE(v1.18) tags
to bits of the API that need cleanup.

Live tested on EC2 - after copying the tools from
/tools/releases/ to /tools/ the upgrade proceeds
and finishes successfully.

https://codereview.appspot.com/14231044/

R=fwereade, jameinel

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
        apiagent "launchpad.net/juju-core/state/api/agent"
20
20
        apideployer "launchpad.net/juju-core/state/api/deployer"
21
21
        "launchpad.net/juju-core/state/api/params"
22
 
        "launchpad.net/juju-core/tools"
 
22
        "launchpad.net/juju-core/version"
23
23
        "launchpad.net/juju-core/worker"
24
24
        "launchpad.net/juju-core/worker/deployer"
25
25
        "launchpad.net/juju-core/worker/upgrader"
86
86
// The AgentState interface is implemented by state types
87
87
// that represent running agents.
88
88
type AgentState interface {
89
 
        // SetAgentTools sets the tools that the agent is currently running.
90
 
        SetAgentTools(tools *tools.Tools) error
 
89
        // SetAgentVersion sets the tools version that the agent is
 
90
        // currently running.
 
91
        SetAgentVersion(v version.Binary) error
91
92
        Tag() string
92
93
        SetMongoPassword(password string) error
93
94
        Life() state.Life