Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5)

Side by Side Diff: cmd/jujud/agent.go

Issue 11561044: Make agent/tools and remove state.Tools
Patch Set: Created 11 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012, 2013 Canonical Ltd. 1 // Copyright 2012, 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package main 4 package main
5 5
6 import ( 6 import (
7 "fmt" 7 "fmt"
8 "io" 8 "io"
9 "time" 9 "time"
10 10
11 "launchpad.net/gnuflag" 11 "launchpad.net/gnuflag"
12 12
13 "launchpad.net/juju-core/agent" 13 "launchpad.net/juju-core/agent"
14 "launchpad.net/juju-core/agent/tools"
14 "launchpad.net/juju-core/cmd" 15 "launchpad.net/juju-core/cmd"
15 "launchpad.net/juju-core/errors" 16 "launchpad.net/juju-core/errors"
16 "launchpad.net/juju-core/log" 17 "launchpad.net/juju-core/log"
17 "launchpad.net/juju-core/state" 18 "launchpad.net/juju-core/state"
18 "launchpad.net/juju-core/state/api" 19 "launchpad.net/juju-core/state/api"
19 "launchpad.net/juju-core/state/api/params" 20 "launchpad.net/juju-core/state/api/params"
20 "launchpad.net/juju-core/worker" 21 "launchpad.net/juju-core/worker"
21 "launchpad.net/juju-core/worker/deployer" 22 "launchpad.net/juju-core/worker/deployer"
22 ) 23 )
23 24
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 type Agent interface { 80 type Agent interface {
80 Entity(st *state.State) (AgentState, error) 81 Entity(st *state.State) (AgentState, error)
81 APIEntity(st *api.State) (AgentAPIState, error) 82 APIEntity(st *api.State) (AgentAPIState, error)
82 Tag() string 83 Tag() string
83 } 84 }
84 85
85 // The AgentState interface is implemented by state types 86 // The AgentState interface is implemented by state types
86 // that represent running agents. 87 // that represent running agents.
87 type AgentState interface { 88 type AgentState interface {
88 // SetAgentTools sets the tools that the agent is currently running. 89 // SetAgentTools sets the tools that the agent is currently running.
89 » SetAgentTools(tools *state.Tools) error 90 » SetAgentTools(tools *tools.Tools) error
90 Tag() string 91 Tag() string
91 SetMongoPassword(password string) error 92 SetMongoPassword(password string) error
92 Life() state.Life 93 Life() state.Life
93 } 94 }
94 95
95 type AgentAPIState interface { 96 type AgentAPIState interface {
96 Life() params.Life 97 Life() params.Life
97 SetPassword(password string) error 98 SetPassword(password string) error
98 } 99 }
99 100
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // tests can be run without waiting for the 5s watcher refresh time to which we would 234 // tests can be run without waiting for the 5s watcher refresh time to which we would
234 // otherwise be restricted. 235 // otherwise be restricted.
235 var newDeployContext = func(st *state.State, dataDir string) deployer.Context { 236 var newDeployContext = func(st *state.State, dataDir string) deployer.Context {
236 return deployer.NewSimpleContext(dataDir, st.CACert(), st) 237 return deployer.NewSimpleContext(dataDir, st.CACert(), st)
237 } 238 }
238 239
239 func newDeployer(st *state.State, machineId string, dataDir string) *deployer.De ployer { 240 func newDeployer(st *state.State, machineId string, dataDir string) *deployer.De ployer {
240 ctx := newDeployContext(st, dataDir) 241 ctx := newDeployContext(st, dataDir)
241 return deployer.NewDeployer(st, ctx, machineId) 242 return deployer.NewDeployer(st, ctx, machineId)
242 } 243 }
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b