1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Warn (but don't fail) if creds.json file does not exist (#425)

This commit is contained in:
Tom Limoncelli
2018-12-11 11:56:06 -05:00
committed by GitHub
parent 38074df158
commit bb8d0cacb6

View File

@ -6,6 +6,7 @@ package config
import (
"encoding/json"
"fmt"
"os"
"strings"
@ -21,6 +22,7 @@ func LoadProviderConfigs(fname string) (map[string]map[string]string, error) {
if err != nil {
// no creds file is ok. Bind requires nothing for example. Individual providers will error if things not found.
if os.IsNotExist(err) {
fmt.Printf("INFO: Config file %q does not exist. Skipping.\n", fname)
return results, nil
}
return nil, errors.Errorf("While reading provider credentials file %v: %v", fname, err)