~bac/juju-core/add-config

« back to all changes in this revision

Viewing changes to cmd/juju/ssh.go

  • Committer: Brad Crittenden
  • Date: 2013-02-19 13:00:57 UTC
  • mfrom: (903.1.5 juju-core)
  • Revision ID: bac@canonical.com-20130219130057-xdustugvge2w06vk
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
        // wait for instance id
96
96
        w := machine.Watch()
97
97
        for _ = range w.Changes() {
98
 
                instid, err := machine.InstanceId()
99
 
                if err == nil {
 
98
                if instid, ok := machine.InstanceId(); ok {
100
99
                        w.Stop()
101
100
                        inst, err := c.Environ.Instances([]state.InstanceId{instid})
102
101
                        if err != nil {
104
103
                        }
105
104
                        return inst[0].WaitDNSName()
106
105
                }
 
106
                // BUG(dfc) this does not refresh the machine, so
 
107
                // this loop will loop forever if it gets to this point.
 
108
                // https://bugs.launchpad.net/juju-core/+bug/1130051
107
109
        }
108
110
        // oops, watcher closed before we could get an answer
109
111
        return "", w.Stop()