File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ import (
27
27
const (
28
28
connectionString = "qemu:///system"
29
29
privateNetworkName = "docker-machines"
30
- dockerConfigDir = "/var/lib/boot2docker"
31
30
isoFilename = "boot2docker.iso"
32
31
dnsmasqLeases = "/var/lib/libvirt/dnsmasq/%s.leases"
33
32
dnsmasqStatus = "/var/lib/libvirt/dnsmasq/%s.status"
@@ -517,7 +516,10 @@ func (d *Driver) getMAC() (string, error) {
517
516
return "" , err
518
517
}
519
518
// Always assume the second interface is the one we want
520
- // TODO harden
519
+ if len (dom .Devices .Interfaces ) < 2 {
520
+ return "" , fmt .Errorf ("VM doesn't have enough network interfaces. Expected at least 2, found %d" ,
521
+ len (dom .Devices .Interfaces ))
522
+ }
521
523
return dom .Devices .Interfaces [1 ].Mac .Address , nil
522
524
}
523
525
@@ -580,6 +582,7 @@ func (d *Driver) getIPByMacFromSettings(mac string) (string, error) {
580
582
}
581
583
582
584
func (d * Driver ) GetIP () (string , error ) {
585
+ log .Debugf ("GetIP called for %s" , d .MachineName )
583
586
mac , err := d .getMAC ()
584
587
if err != nil {
585
588
return "" , err
You can’t perform that action at this time.
0 commit comments