~wallyworld/juju-core/machiner-access-for-uniter

« back to all changes in this revision

Viewing changes to provider/local/environ.go

[r=waigani] Removed shared storage from local provider.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
var _ envtools.SupportsCustomSources = (*localEnviron)(nil)
49
49
 
50
50
type localEnviron struct {
51
 
        localMutex            sync.Mutex
52
 
        config                *environConfig
53
 
        name                  string
54
 
        sharedStorageListener net.Listener
55
 
        storageListener       net.Listener
56
 
        containerManager      container.Manager
 
51
        localMutex       sync.Mutex
 
52
        config           *environConfig
 
53
        name             string
 
54
        storageListener  net.Listener
 
55
        containerManager container.Manager
57
56
}
58
57
 
59
58
// GetToolsSources returns a list of sources which are used to search for simplestreams tools metadata.
138
137
        mcfg.MachineAgentServiceName = env.machineAgentServiceName()
139
138
        mcfg.MongoServiceName = env.mongoServiceName()
140
139
        mcfg.AgentEnvironment = map[string]string{
141
 
                agent.Namespace:         env.config.namespace(),
142
 
                agent.StorageDir:        env.config.storageDir(),
143
 
                agent.StorageAddr:       env.config.storageAddr(),
144
 
                agent.SharedStorageDir:  env.config.sharedStorageDir(),
145
 
                agent.SharedStorageAddr: env.config.sharedStorageAddr(),
 
140
                agent.Namespace:   env.config.namespace(),
 
141
                agent.StorageDir:  env.config.storageDir(),
 
142
                agent.StorageAddr: env.config.storageAddr(),
146
143
        }
147
144
        if err := environs.FinishMachineConfig(mcfg, env.Config(), cons); err != nil {
148
145
                return err
286
283
 
287
284
// setupLocalStorage looks to see if there is someone listening on the storage
288
285
// address port.  If there is we assume that it is ours and all is good.  If
289
 
// there is no one listening on that port, create listeners for both storage
290
 
// and the shared storage for the duration of the commands execution.
 
286
// there is no one listening on that port, create listeners for storage
 
287
// for the duration of the commands execution.
291
288
func (env *localEnviron) setupLocalStorage() error {
292
289
        // Try to listen to the storageAddress.
293
290
        logger.Debugf("checking %s to see if machine agent running storage listener", env.config.storageAddr())
301
298
                if err != nil {
302
299
                        return err
303
300
                }
304
 
                env.sharedStorageListener, err = createLocalStorageListener(env.config.sharedStorageDir(), env.config.sharedStorageAddr())
305
 
                if err != nil {
306
 
                        return err
307
 
                }
308
301
        } else {
309
302
                logger.Debugf("yes, don't start local storage listeners")
310
303
                connection.Close()