From 8d63cea6ab4096ff3fc124fde093c5dcadff2ee5 Mon Sep 17 00:00:00 2001 From: Daniel Hiltgen Date: Thu, 4 Feb 2016 19:56:00 -0800 Subject: [PATCH] Clean up logging a little Reduce some of the scary chatter that isn't necessarily bad during initial startup on a fresh system. --- kvm.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/kvm.go b/kvm.go index 8af72737b50..2591a934c58 100644 --- a/kvm.go +++ b/kvm.go @@ -183,7 +183,7 @@ func (d *Driver) GetURL() (string, error) { log.Debugf("GetURL called") ip, err := d.GetIP() if err != nil { - log.Warnf("Failed to get IP: %s", err) + log.Debugf("Failed to get IP: %s", err) return "", err } if ip == "" { @@ -300,7 +300,7 @@ func (d *Driver) Create() error { return err } - log.Infof("Creating SSH key...") + log.Debug("Creating SSH key...") if err := ssh.GenerateSSHKey(d.GetSSHKeyPath()); err != nil { return err } @@ -325,12 +325,12 @@ func (d *Driver) Create() error { } } - log.Debugf("Creating VM data disk...") + log.Debug("Creating VM data disk...") if err := d.generateDiskImage(d.DiskSize); err != nil { return err } - log.Debugf("Defining VM...") + log.Debug("Defining VM...") tmpl, err := template.New("domain").Parse(domainXMLTemplate) if err != nil { return err @@ -559,6 +559,9 @@ func (d *Driver) getIPByMacFromSettings(mac string) (string, error) { } statusFile := fmt.Sprintf(dnsmasqStatus, bridge_name) data, err := ioutil.ReadFile(statusFile) + if err != nil { + return "", err + } type Lease struct { Ip_address string `json:"ip-address"` Mac_address string `json:"mac-address"` @@ -568,7 +571,7 @@ func (d *Driver) getIPByMacFromSettings(mac string) (string, error) { err = json.Unmarshal(data, &s) if err != nil { - log.Warnf("Failed to decode dnsmasq lease status: %s", err) + log.Debugf("Failed to decode dnsmasq lease status: %s", err) return "", err } for _, value := range s {