LEFT | RIGHT |
1 package cloudinit | 1 package cloudinit |
2 | 2 |
3 import ( | 3 import ( |
4 "encoding/base64" | 4 "encoding/base64" |
5 "fmt" | 5 "fmt" |
6 "launchpad.net/goyaml" | 6 "launchpad.net/goyaml" |
7 "launchpad.net/juju-core/cloudinit" | 7 "launchpad.net/juju-core/cloudinit" |
8 "launchpad.net/juju-core/environs" | 8 "launchpad.net/juju-core/environs" |
9 "launchpad.net/juju-core/environs/config" | 9 "launchpad.net/juju-core/environs/config" |
10 "launchpad.net/juju-core/log" | 10 "launchpad.net/juju-core/log" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // Make the agent run via a symbolic link to the actual tools | 159 // Make the agent run via a symbolic link to the actual tools |
160 // directory, so it can upgrade itself without needing to change | 160 // directory, so it can upgrade itself without needing to change |
161 // the upstart script. | 161 // the upstart script. |
162 toolsDir := environs.AgentToolsDir(cfg.DataDir, name) | 162 toolsDir := environs.AgentToolsDir(cfg.DataDir, name) |
163 addScripts(c, fmt.Sprintf("ln -s $bin %s", toolsDir)) | 163 addScripts(c, fmt.Sprintf("ln -s $bin %s", toolsDir)) |
164 svc := upstart.NewService(fmt.Sprintf("jujud-%s", name)) | 164 svc := upstart.NewService(fmt.Sprintf("jujud-%s", name)) |
165 cmd := fmt.Sprintf( | 165 cmd := fmt.Sprintf( |
166 "%s/jujud %s"+ | 166 "%s/jujud %s"+ |
167 " --zookeeper-servers '%s'"+ | 167 " --zookeeper-servers '%s'"+ |
168 " --log-file /var/log/juju/%s-agent.log"+ | 168 " --log-file /var/log/juju/%s-agent.log"+ |
169 » » » " --data-directory '%s'"+ | 169 » » » " --data-dir '%s'"+ |
170 " %s", | 170 " %s", |
171 toolsDir, name, | 171 toolsDir, name, |
172 cfg.zookeeperHostAddrs(), | 172 cfg.zookeeperHostAddrs(), |
173 name, | 173 name, |
174 cfg.DataDir, | 174 cfg.DataDir, |
175 args, | 175 args, |
176 ) | 176 ) |
177 conf := &upstart.Conf{ | 177 conf := &upstart.Conf{ |
178 Service: *svc, | 178 Service: *svc, |
179 Desc: fmt.Sprintf("juju %s agent", name), | 179 Desc: fmt.Sprintf("juju %s agent", name), |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 if cfg.Config == nil { | 241 if cfg.Config == nil { |
242 return requiresError("environment configuration") | 242 return requiresError("environment configuration") |
243 } | 243 } |
244 } else { | 244 } else { |
245 if cfg.StateInfo == nil || len(cfg.StateInfo.Addrs) == 0 { | 245 if cfg.StateInfo == nil || len(cfg.StateInfo.Addrs) == 0 { |
246 return requiresError("zookeeper hosts") | 246 return requiresError("zookeeper hosts") |
247 } | 247 } |
248 } | 248 } |
249 return nil | 249 return nil |
250 } | 250 } |
LEFT | RIGHT |