LEFT | RIGHT |
1 package uniter | 1 package uniter |
2 | 2 |
3 import ( | 3 import ( |
4 "errors" | 4 "errors" |
5 "fmt" | 5 "fmt" |
6 "launchpad.net/juju-core/cmd" | 6 "launchpad.net/juju-core/cmd" |
7 "launchpad.net/juju-core/cmd/jujuc/server" | 7 "launchpad.net/juju-core/cmd/jujuc/server" |
8 "launchpad.net/juju-core/log" | 8 "launchpad.net/juju-core/log" |
9 "launchpad.net/juju-core/state" | 9 "launchpad.net/juju-core/state" |
10 "launchpad.net/juju-core/state/presence" | 10 "launchpad.net/juju-core/state/presence" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } | 195 } |
196 log.Printf("hook complete") | 196 log.Printf("hook complete") |
197 return nil | 197 return nil |
198 } | 198 } |
199 | 199 |
200 // ensureFs ensures that files and directories required by the named uniter | 200 // ensureFs ensures that files and directories required by the named uniter |
201 // exist inside dataDir. It returns the path to the directory within which the u
niter must | 201 // exist inside dataDir. It returns the path to the directory within which the u
niter must |
202 // store its data. | 202 // store its data. |
203 func ensureFs(dataDir string, unit *state.Unit) (string, error) { | 203 func ensureFs(dataDir string, unit *state.Unit) (string, error) { |
204 // TODO: do this OAOO at packaging time? | 204 // TODO: do this OAOO at packaging time? |
205 » if err := EnsureJujucSymlinks(dataDir, unit.AgentName()); err != nil { | 205 » if err := EnsureJujucSymlinks(dataDir, unit.PathKey()); err != nil { |
206 return "", err | 206 return "", err |
207 } | 207 } |
208 » path := filepath.Join(dataDir, "agents", unit.AgentName()) | 208 » path := filepath.Join(dataDir, "agents", unit.PathKey()) |
209 if err := trivial.EnsureDir(filepath.Join(path, "state")); err != nil { | 209 if err := trivial.EnsureDir(filepath.Join(path, "state")); err != nil { |
210 return "", err | 210 return "", err |
211 } | 211 } |
212 return path, nil | 212 return path, nil |
213 } | 213 } |
LEFT | RIGHT |