From 646523c5f4e2dd1791160434df557b7427288a09 Mon Sep 17 00:00:00 2001 From: Ali Rizvi-Santiago Date: Thu, 29 Mar 2018 13:04:25 -0500 Subject: [PATCH] Replaced the call to os.Open and ReadNetworkMap to just a single call to ReadNetmapConfig in both the Workstation9 and Player5 VMware drivers. --- builder/vmware/common/driver_player5.go | 9 ++------- builder/vmware/common/driver_workstation9.go | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/builder/vmware/common/driver_player5.go b/builder/vmware/common/driver_player5.go index fb14dcb52..5f492e6be 100644 --- a/builder/vmware/common/driver_player5.go +++ b/builder/vmware/common/driver_player5.go @@ -201,14 +201,9 @@ func (d *Player5Driver) Verify() error { if _, err := os.Stat(pathNetmap); err != nil { 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) - if err != nil { - return nil, err - } - defer fd.Close() - - return ReadNetworkMap(fd) + return ReadNetmapConfig(pathNetmap) } return nil } diff --git a/builder/vmware/common/driver_workstation9.go b/builder/vmware/common/driver_workstation9.go index 25b4ddd2c..8186ac83f 100644 --- a/builder/vmware/common/driver_workstation9.go +++ b/builder/vmware/common/driver_workstation9.go @@ -162,14 +162,9 @@ func (d *Workstation9Driver) Verify() error { if _, err := os.Stat(pathNetmap); err != nil { 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) - if err != nil { - return nil, err - } - defer fd.Close() - - return ReadNetworkMap(fd) + return ReadNetmapConfig(pathNetmap) } return nil }