~rogpeppe/juju-core/438-local-instance-Addresses

« back to all changes in this revision

Viewing changes to environs/dummy/environs.go

mergeĀ 024-jujuconnsuite-logging

Show diffs side-by-side

added added

removed removed

Lines of Context:
269
269
        state := p.state[name]
270
270
        if state == nil {
271
271
                if ecfg.zookeeper() && len(p.state) != 0 {
272
 
                        panic("cannot share a zookeeper between two dummy environs")
 
272
                        var old string
 
273
                        for oldName := range p.state {
 
274
                                old = oldName
 
275
                                break
 
276
                        }
 
277
                        panic(fmt.Errorf("cannot share a zookeeper between two dummy environs; old %q; new %q", old, name))
273
278
                }
274
279
                state = newState(name, p.ops)
275
280
                p.state[name] = state
412
417
}
413
418
 
414
419
func (e *environ) StartInstance(machineId int, info *state.Info, tools *state.Tools) (environs.Instance, error) {
 
420
        log.Printf("dummy startinstance, machine %d", machineId)
415
421
        if err := e.checkBroken("StartInstance"); err != nil {
416
422
                return nil, err
417
423
        }
514
520
}
515
521
 
516
522
func (inst *instance) OpenPorts(machineId int, ports []state.Port) error {
 
523
        log.Printf("openPorts %d, %#v", machineId, ports)
517
524
        if inst.machineId != machineId {
518
525
                panic(fmt.Errorf("OpenPorts with mismatched machine id, expected %d got %d", inst.machineId, machineId))
519
526
        }