Replaced the call to os.Open and ReadNetworkMap to just a single call to ReadNetmapConfig in both the Workstation9 and Player5 VMware drivers.
This commit is contained in:
parent
f2fc064037
commit
646523c5f4
|
@ -201,14 +201,9 @@ func (d *Player5Driver) Verify() error {
|
||||||
if _, err := os.Stat(pathNetmap); err != nil {
|
if _, err := os.Stat(pathNetmap); err != nil {
|
||||||
return nil, fmt.Errorf("Could not find netmap conf file: %s", pathNetmap)
|
return nil, fmt.Errorf("Could not find netmap conf file: %s", pathNetmap)
|
||||||
}
|
}
|
||||||
|
log.Printf("Located networkmapper configuration file using Player: %s", pathNetmap)
|
||||||
|
|
||||||
fd, err := os.Open(pathNetmap)
|
return ReadNetmapConfig(pathNetmap)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer fd.Close()
|
|
||||||
|
|
||||||
return ReadNetworkMap(fd)
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,14 +162,9 @@ func (d *Workstation9Driver) Verify() error {
|
||||||
if _, err := os.Stat(pathNetmap); err != nil {
|
if _, err := os.Stat(pathNetmap); err != nil {
|
||||||
return nil, fmt.Errorf("Could not find netmap conf file: %s", pathNetmap)
|
return nil, fmt.Errorf("Could not find netmap conf file: %s", pathNetmap)
|
||||||
}
|
}
|
||||||
|
log.Printf("Located networkmapper configuration file using Workstation: %s", pathNetmap)
|
||||||
|
|
||||||
fd, err := os.Open(pathNetmap)
|
return ReadNetmapConfig(pathNetmap)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer fd.Close()
|
|
||||||
|
|
||||||
return ReadNetworkMap(fd)
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue