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:
Ali Rizvi-Santiago 2018-03-29 13:04:25 -05:00
parent f2fc064037
commit 646523c5f4
2 changed files with 4 additions and 14 deletions

View File

@ -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
} }

View File

@ -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
} }