puppet: Clean up the GAPI and remove log package

This uses the proper facilities which makes things a bit more uniform.
This commit is contained in:
James Shubin
2018-04-19 01:56:31 -04:00
parent 9969286224
commit 86a9181e9b
2 changed files with 31 additions and 33 deletions

View File

@@ -20,7 +20,6 @@ package puppet
import (
"fmt"
"io/ioutil"
"log"
"os"
"strings"
"sync"
@@ -246,7 +245,10 @@ func (obj *GAPI) Graph() (*pgraph.Graph, error) {
if !obj.initialized {
return nil, fmt.Errorf("%s: GAPI is not initialized", Name)
}
config := obj.ParseConfigFromPuppet()
config, err := obj.ParseConfigFromPuppet()
if err != nil {
return nil, err
}
if config == nil {
return nil, fmt.Errorf("function ParseConfigFromPuppet returned nil")
}
@@ -297,7 +299,7 @@ func (obj *GAPI) Next() chan gapi.Next {
return
}
log.Printf("%s: Generating new graph...", Name)
obj.data.Logf("generating new graph...")
if obj.data.NoStreamWatch {
pChan = nil
} else {