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

Delta Between Two Patch Sets: worker/provisioner/container_initialisation.go

Issue 72270044: lxc: Fixed target-release issue precise/maas
Left Patch Set: cloudinit: Fixed target-release issue precise/maas Created 11 years, 1 month ago
Right Patch Set: lxc: Fixed target-release issue precise/maas Created 11 years, 1 month 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:
Right: Side by side diff | Download
LEFTRIGHT
(no file at all)
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 "sync/atomic" 8 "sync/atomic"
9 9
10 "launchpad.net/juju-core/agent" 10 "launchpad.net/juju-core/agent"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 func (cs *ContainerSetup) getContainerArtifacts(containerType instance.Container Type) (container.Initialiser, environs.InstanceBroker, error) { 137 func (cs *ContainerSetup) getContainerArtifacts(containerType instance.Container Type) (container.Initialiser, environs.InstanceBroker, error) {
138 tools, err := cs.provisioner.Tools(cs.config.Tag()) 138 tools, err := cs.provisioner.Tools(cs.config.Tag())
139 if err != nil { 139 if err != nil {
140 logger.Errorf("cannot get tools from machine for %s container", containerType) 140 logger.Errorf("cannot get tools from machine for %s container", containerType)
141 return nil, nil, err 141 return nil, nil, err
142 } 142 }
143 var initialiser container.Initialiser 143 var initialiser container.Initialiser
144 var broker environs.InstanceBroker 144 var broker environs.InstanceBroker
145 switch containerType { 145 switch containerType {
146 case instance.LXC: 146 case instance.LXC:
147 » » initialiser = lxc.NewContainerInitialiser() 147 » » series, err := cs.machine.Series()
148 » » if err != nil {
149 » » » return nil, nil, err
150 » » }
151
152 » » initialiser = lxc.NewContainerInitialiser(series)
148 broker, err = NewLxcBroker(cs.provisioner, tools, cs.config) 153 broker, err = NewLxcBroker(cs.provisioner, tools, cs.config)
149 if err != nil { 154 if err != nil {
150 return nil, nil, err 155 return nil, nil, err
151 } 156 }
152 case instance.KVM: 157 case instance.KVM:
153 initialiser = kvm.NewContainerInitialiser() 158 initialiser = kvm.NewContainerInitialiser()
154 broker, err = NewKvmBroker(cs.provisioner, tools, cs.config) 159 broker, err = NewKvmBroker(cs.provisioner, tools, cs.config)
155 if err != nil { 160 if err != nil {
156 logger.Errorf("failed to create new kvm broker") 161 logger.Errorf("failed to create new kvm broker")
157 return nil, nil, err 162 return nil, nil, err
(...skipping 12 matching lines...) Expand all
170 func startProvisionerWorker(runner worker.Runner, containerType instance.Contain erType, 175 func startProvisionerWorker(runner worker.Runner, containerType instance.Contain erType,
171 provisioner *apiprovisioner.State, config agent.Config, broker environs. InstanceBroker) error { 176 provisioner *apiprovisioner.State, config agent.Config, broker environs. InstanceBroker) error {
172 177
173 workerName := fmt.Sprintf("%s-provisioner", containerType) 178 workerName := fmt.Sprintf("%s-provisioner", containerType)
174 // The provisioner task is created after a container record has already been added to the machine. 179 // The provisioner task is created after a container record has already been added to the machine.
175 // It will see that the container does not have an instance yet and crea te one. 180 // It will see that the container does not have an instance yet and crea te one.
176 return runner.StartWorker(workerName, func() (worker.Worker, error) { 181 return runner.StartWorker(workerName, func() (worker.Worker, error) {
177 return NewContainerProvisioner(containerType, provisioner, confi g, broker), nil 182 return NewContainerProvisioner(containerType, provisioner, confi g, broker), nil
178 }) 183 })
179 } 184 }
LEFTRIGHT

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