Merge lp:~thumper/juju-core/move-tools-dir into lp:~go-bot/juju-core/trunk
Proposed by
Tim Penhey
Status: | Merged |
---|---|
Approved by: | Tim Penhey |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1734 |
Proposed branch: | lp:~thumper/juju-core/move-tools-dir |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
79 lines (+9/-10) 4 files modified
agent/agent.go (+7/-3) agent/tools/toolsdir.go (+0/-5) worker/deployer/simple.go (+1/-1) worker/deployer/simple_test.go (+1/-1) |
To merge this branch: | bzr merge lp:~thumper/juju-core/move-tools-dir |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+182777@code.launchpad.net |
Commit message
Move the Dir function from agent/tools to agent.
Part of the agent refactoring, and this is the only bit
that touched parts outside of the agent package.
Description of the change
Move the Dir function from agent/tools to agent.
Part of the agent refactoring, and this is the only bit
that touched parts outside of the agent package.
To post a comment you must log in.
Reviewers: mp+182777_ code.launchpad. net,
Message:
Please take a look.
Description:
Move the Dir function from agent/tools to agent.
Part of the agent refactoring, and this is the only bit
that touched parts outside of the agent package.
https:/ /code.launchpad .net/~thumper/ juju-core/ move-tools- dir/+merge/ 182777
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/13256045/
Affected files: toolsdir. go deployer/ simple. go deployer/ simple_ test.go
A [revision details]
M agent/agent.go
M agent/tools/
M worker/
M worker/
Index: [revision details] 20130827122923- qx3dpiw3118bbub 2
=== 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: tarmac-
+New revision: <email address hidden>
Index: agent/agent.go net/goyaml" net/loggo"
=== modified file 'agent/agent.go'
--- agent/agent.go 2013-08-22 23:04:04 +0000
+++ agent/agent.go 2013-08-28 22:59:45 +0000
@@ -13,7 +13,6 @@
"launchpad.
"launchpad.
- "launchpad. net/juju- core/agent/ tools" net/juju- core/environs/ config" net/juju- core/errors" net/juju- core/state"
"launchpad.
"launchpad.
"launchpad.
@@ -198,10 +197,15 @@
return conf, nil
}
+// Dir returns the agent-specific data directory. ReadFile( path.Join( dir, "agent.conf"))
+func Dir(dataDir, agentName string) string {
+ return path.Join(dataDir, "agents", agentName)
+}
+
// ReadConf reads configuration data for the given
// entity from the given data directory.
func ReadConf(dataDir, tag string) (Config, error) {
- dir := tools.Dir(dataDir, tag)
+ dir := Dir(dataDir, tag)
data, err := ioutil.
if err != nil {
return nil, err
@@ -259,7 +263,7 @@
// Dir returns the agent's directory. c.dataDir, c.Tag())
func (c *conf) Dir() string {
- return tools.Dir(
+ return Dir(c.dataDir, c.Tag())
}
// Check checks that the configuration has all the required elements.
Index: agent/tools/ toolsdir. go tools/toolsdir. go' toolsdir. go 2013-08-21 05:38:38 +0000 toolsdir. go 2013-08-28 22:59:45 +0000
=== modified file 'agent/
--- agent/tools/
+++ agent/tools/
@@ -33,11 +33,6 @@
return path.Join(dataDir, "tools", agentName)
}
-// Dir returns the agent-specific data directory.
-func Dir(dataDir, agentName string) string {
- return path.Join(dataDir, "agents", agentName)
-}
-
// UnpackTools reads a set of juju tools in gzipped tar-archive
// format and unpacks them into the appropriate tools directory
// within dataDir. If a valid tools directory already exists,
Index: worker/ deployer/ simple. go deployer/ simple. go' deployer/ simple. go 2013-08-22 03:39:33 +0000 deployer/ simple. go 2013-08-28 22:59:45 +0000 unitName) ctx.dataDir, tag) ctx.dataDir, tag) agentDir) ; err != nil {
=== modified file 'worker/
--- worker/
+++ worker/
@@ -175,7 +175,7 @@
return err
}
tag := names.UnitTag(
- agentDir := tools.Dir(
+ agentDir := agent.Dir(
if err := os.RemoveAll(
return err
}
Index: worker/ deployer/ simple_ test.go deployer/ simple_ test.go' deployer/ simple_ test.go 2013-08-21 04:21:06 +0000
=== modified file 'worker/
--- worker/
+++ w...