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

Delta Between Two Patch Sets: state/apiserver/provisioner/provisioner.go

Issue 96140044: Introduce lxc-use-clone, ContainerManagerConfig
Left Patch Set: Introduce lxc-use-clone, ContainerManagerConfig Created 9 years, 10 months ago
Right Patch Set: Introduce lxc-use-clone, ContainerManagerConfig Created 9 years, 10 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « state/api/provisioner/provisioner_test.go ('k') | state/apiserver/provisioner/provisioner_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 provisioner 4 package provisioner
5 5
6 import ( 6 import (
7 "fmt" 7 "fmt"
8 8
9 "launchpad.net/juju-core/constraints" 9 "launchpad.net/juju-core/constraints"
10 "launchpad.net/juju-core/container" 10 "launchpad.net/juju-core/container"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 } else { 184 } else {
185 err = machine.SetSupportedContainers(arg.ContainerTypes) 185 err = machine.SetSupportedContainers(arg.ContainerTypes)
186 } 186 }
187 if err != nil { 187 if err != nil {
188 result.Results[i].Error = common.ServerError(err) 188 result.Results[i].Error = common.ServerError(err)
189 } 189 }
190 } 190 }
191 return result, nil 191 return result, nil
192 } 192 }
193 193
194 // ContainerManagerConfig returns information from the environment config that a re 194 // ContainerManagerConfig returns information from the environment config that i s
195 // needed for configuring the container manager. 195 // needed for configuring the container manager.
196 func (p *ProvisionerAPI) ContainerManagerConfig(args params.ContainerManagerConf igParams) (params.ContainerManagerConfig, error) { 196 func (p *ProvisionerAPI) ContainerManagerConfig(args params.ContainerManagerConf igParams) (params.ContainerManagerConfig, error) {
197 var result params.ContainerManagerConfig 197 var result params.ContainerManagerConfig
198 config, err := p.st.EnvironConfig() 198 config, err := p.st.EnvironConfig()
199 if err != nil { 199 if err != nil {
200 return result, err 200 return result, err
201 } 201 }
202 cfg := make(map[string]string) 202 cfg := make(map[string]string)
203 cfg[container.ConfigName] = "juju" 203 cfg[container.ConfigName] = "juju"
204 switch args.Type { 204 switch args.Type {
205 case instance.LXC: 205 case instance.LXC:
206 cfg["use-clone"] = fmt.Sprint(config.LXCUseClone()) 206 cfg["use-clone"] = fmt.Sprint(config.LXCUseClone())
207 } 207 }
208 result.ManagerConfig = cfg 208 result.ManagerConfig = cfg
209 return result, nil 209 return result, nil
210 } 210 }
211 211
212 // ContainerConfig returns information from the environment config that are 212 // ContainerConfig returns information from the environment config that is
213 // needed for container cloud-init. 213 // needed for container cloud-init.
214 func (p *ProvisionerAPI) ContainerConfig() (params.ContainerConfig, error) { 214 func (p *ProvisionerAPI) ContainerConfig() (params.ContainerConfig, error) {
215 result := params.ContainerConfig{} 215 result := params.ContainerConfig{}
216 config, err := p.st.EnvironConfig() 216 config, err := p.st.EnvironConfig()
217 if err != nil { 217 if err != nil {
218 return result, err 218 return result, err
219 } 219 }
220 result.ProviderType = config.Type() 220 result.ProviderType = config.Type()
221 result.AuthorizedKeys = config.AuthorizedKeys() 221 result.AuthorizedKeys = config.AuthorizedKeys()
222 result.SSLHostnameVerification = config.SSLHostnameVerification() 222 result.SSLHostnameVerification = config.SSLHostnameVerification()
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 } 606 }
607 watch := newWatchMachineErrorRetry() 607 watch := newWatchMachineErrorRetry()
608 // Consume any initial event and forward it to the result. 608 // Consume any initial event and forward it to the result.
609 if _, ok := <-watch.Changes(); ok { 609 if _, ok := <-watch.Changes(); ok {
610 result.NotifyWatcherId = p.resources.Register(watch) 610 result.NotifyWatcherId = p.resources.Register(watch)
611 } else { 611 } else {
612 return result, watcher.MustErr(watch) 612 return result, watcher.MustErr(watch)
613 } 613 }
614 return result, nil 614 return result, nil
615 } 615 }
LEFTRIGHT

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