debug.go 446 B

1234567891011121314151617181920212223
  1. package debug
  2. import (
  3. "github.com/rancher/os/config"
  4. "github.com/rancher/os/pkg/log"
  5. )
  6. func PrintAndLoadConfig(_ *config.CloudConfig) (*config.CloudConfig, error) {
  7. PrintConfig()
  8. cfg := config.LoadConfig()
  9. return cfg, nil
  10. }
  11. func PrintConfig() {
  12. cfgString, err := config.Export(false, true)
  13. if err != nil {
  14. log.WithFields(log.Fields{"err": err}).Error("Error serializing config")
  15. } else {
  16. log.Debugf("Config: %s", cfgString)
  17. }
  18. }