Code review comment for lp:~axwalk/juju-core/lp1293198-agent-dir-path

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Reviewers: mp+211850_code.launchpad.net,

Message:
Please take a look.

Description:
agent: format agent dir correctly on Windows

The agent package was changed for upgrades,
and we regressed on Windows. The agent Dir
method must return *nix paths regardless of
what OS the code is built for.

Fixes lp:1293198

https://code.launchpad.net/~axwalk/juju-core/lp1293198-agent-dir-path/+merge/211850

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/75190045/

Affected files (+5, -1 lines):
   A [revision details]
   M agent/agent.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: tarmac-20140320011142-7ljymhlzvpq44apl
+New revision: <email address hidden>

Index: agent/agent.go
=== modified file 'agent/agent.go'
--- agent/agent.go 2014-03-19 11:45:36 +0000
+++ agent/agent.go 2014-03-20 02:14:29 +0000
@@ -327,7 +327,9 @@

  // Dir returns the agent-specific data directory.
  func Dir(dataDir, agentName string) string {
- return filepath.Join(dataDir, "agents", agentName)
+ // Note: must use path, not filepath, as this
+ // function is used by the client on Windows.
+ return path.Join(dataDir, "agents", agentName)
  }

  // ConfigPath returns the full path to the agent config file.

« Back to merge proposal