mirror of https://github.com/docker/docs.git
Only get the IP of a running machine
Signed-off-by: David Gageot <david@gageot.net>
This commit is contained in:
parent
af87c000d2
commit
0c783976e0
|
@ -356,6 +356,14 @@ func (d *Driver) Kill() error {
|
|||
}
|
||||
|
||||
func (d *Driver) GetIP() (string, error) {
|
||||
s, err := d.GetState()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if s != state.Running {
|
||||
return "", drivers.ErrHostIsNotRunning
|
||||
}
|
||||
|
||||
stdout, err := cmdOut("((", "Get-VM", d.MachineName, ").networkadapters[0]).ipaddresses[0]")
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
Loading…
Reference in New Issue