Skip to content

Commit 8d63cea

Browse files
author
Daniel Hiltgen
committed
Clean up logging a little
Reduce some of the scary chatter that isn't necessarily bad during initial startup on a fresh system.
1 parent 4bc0ec9 commit 8d63cea

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

kvm.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func (d *Driver) GetURL() (string, error) {
183183
log.Debugf("GetURL called")
184184
ip, err := d.GetIP()
185185
if err != nil {
186-
log.Warnf("Failed to get IP: %s", err)
186+
log.Debugf("Failed to get IP: %s", err)
187187
return "", err
188188
}
189189
if ip == "" {
@@ -300,7 +300,7 @@ func (d *Driver) Create() error {
300300
return err
301301
}
302302

303-
log.Infof("Creating SSH key...")
303+
log.Debug("Creating SSH key...")
304304
if err := ssh.GenerateSSHKey(d.GetSSHKeyPath()); err != nil {
305305
return err
306306
}
@@ -325,12 +325,12 @@ func (d *Driver) Create() error {
325325
}
326326
}
327327

328-
log.Debugf("Creating VM data disk...")
328+
log.Debug("Creating VM data disk...")
329329
if err := d.generateDiskImage(d.DiskSize); err != nil {
330330
return err
331331
}
332332

333-
log.Debugf("Defining VM...")
333+
log.Debug("Defining VM...")
334334
tmpl, err := template.New("domain").Parse(domainXMLTemplate)
335335
if err != nil {
336336
return err
@@ -559,6 +559,9 @@ func (d *Driver) getIPByMacFromSettings(mac string) (string, error) {
559559
}
560560
statusFile := fmt.Sprintf(dnsmasqStatus, bridge_name)
561561
data, err := ioutil.ReadFile(statusFile)
562+
if err != nil {
563+
return "", err
564+
}
562565
type Lease struct {
563566
Ip_address string `json:"ip-address"`
564567
Mac_address string `json:"mac-address"`
@@ -568,7 +571,7 @@ func (d *Driver) getIPByMacFromSettings(mac string) (string, error) {
568571

569572
err = json.Unmarshal(data, &s)
570573
if err != nil {
571-
log.Warnf("Failed to decode dnsmasq lease status: %s", err)
574+
log.Debugf("Failed to decode dnsmasq lease status: %s", err)
572575
return "", err
573576
}
574577
for _, value := range s {

0 commit comments

Comments
 (0)