func CheckAndUpgradeConfig() error {
	datadogConfPath := filepath.Join(DefaultConfPath, "datadog.conf")
	if _, err := os.Stat(datadogConfPath); os.IsNotExist(err) {
		log.Debug("Previous config file not found, not upgrading")
		return nil
	}
	config.Datadog.AddConfigPath(DefaultConfPath)
	_, err := config.Load()
	if err == nil {
		// was able to read config, check for api key
		if config.Datadog.GetString("api_key") != "" {
			log.Debug("Datadog.yaml found, and API key present.  Not upgrading config")
			return nil
		}
	}
	return ImportConfig(DefaultConfPath, DefaultConfPath, false)
}
// CheckAndUpgradeConfig checks to see if there's an old datadog.conf, and if
// datadog.yaml is either missing or incomplete (no API key).  If so, upgrade it
CheckAndUpgradeConfig checks to see if there's an old datadog.conf, and if
datadog.yaml is either missing or incomplete (no API key).  If so, upgrade it
// CheckAndUpgradeConfig checks to see if there ' s an old datadog . conf and if // datadog . yaml is either missing or incomplete ( no API key ) . If so upgrade it
func CheckAndUpgradeConfig() error {
	datadogConfPath := filepath.Join(DefaultConfPath, "datadog.conf")
	if _, err := os.Stat(datadogConfPath); os.IsNotExist(err) {
		log.Debug("Previous config file not found, not upgrading")
		return nil
	}
	config.Datadog.AddConfigPath(DefaultConfPath)
	_, err := config.Load()
	if err == nil {
		if config.Datadog.GetString("api_key") != "" {
			log.Debug("Datadog.yaml found, and API key present.  Not upgrading config")
			return nil
		}
	}
	return ImportConfig(DefaultConfPath, DefaultConfPath, false)
}
func CheckAndUpgradeConfig ( ) error { datadogConfPath := filepath . Join ( DefaultConfPath , " " ) if _ , err := os . Stat ( datadogConfPath ) ; os . IsNotExist ( err ) { log . Debug ( " " ) return nil } config . Datadog . AddConfigPath ( DefaultConfPath ) _ , err := config . Load ( ) if err == nil { if config . Datadog . GetString ( " " ) != " " { log . Debug ( " " ) return nil } } return ImportConfig ( DefaultConfPath , DefaultConfPath , false ) }
CheckAndUpgradeConfig checks to see if there's an old datadog.conf, and if
datadog.yaml is either missing or incomplete (no API key).
CheckAndUpgradeConfig checks to see if there ' s an old datadog . conf and if datadog . yaml is either missing or incomplete ( no API key ) .
// was able to read config, check for api key