mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Limit the amount of prints during normal runs
This removes some Debugf() calls and chages some direct prints to Debugf(). This means we don't get a bunch of spew when running the tests.
This commit is contained in:
parent
d47c18c5fb
commit
bc7fa7b957
3 changed files with 8 additions and 11 deletions
|
@ -1,6 +1,7 @@
|
|||
package devmapper
|
||||
|
||||
import (
|
||||
"github.com/dotcloud/docker/utils"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
|
@ -184,7 +185,7 @@ func (devices *DeviceSetDM) ensureImage(name string, size int64) (string, error)
|
|||
}
|
||||
|
||||
func (devices *DeviceSetDM) createPool(dataFile *os.File, metadataFile *os.File) error {
|
||||
log.Printf("Activating device-mapper pool %s", devices.getPoolName())
|
||||
utils.Debugf("Activating device-mapper pool %s", devices.getPoolName())
|
||||
task, err := devices.createTask(DeviceCreate, devices.getPoolName())
|
||||
if task == nil {
|
||||
return err
|
||||
|
|
10
image.go
10
image.go
|
@ -339,7 +339,7 @@ func (image *Image) ensureImageDevice(devices DeviceSet) error {
|
|||
|
||||
mounted, err := Mounted(mountDir)
|
||||
if err == nil && mounted {
|
||||
log.Printf("Image %s is unexpectedly mounted, unmounting...", image.ID)
|
||||
utils.Debugf("Image %s is unexpectedly mounted, unmounting...", image.ID)
|
||||
err = syscall.Unmount(mountDir, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -347,21 +347,19 @@ func (image *Image) ensureImageDevice(devices DeviceSet) error {
|
|||
}
|
||||
|
||||
if devices.HasDevice(image.ID) {
|
||||
log.Printf("Found non-initialized demove-mapper device for image %s, removing", image.ID)
|
||||
utils.Debugf("Found non-initialized demove-mapper device for image %s, removing", image.ID)
|
||||
err = devices.RemoveDevice(image.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("Creating device-mapper device for image id %s", image.ID)
|
||||
|
||||
utils.Debugf("Creating device-mapper device for image id %s", image.ID)
|
||||
err = devices.AddDevice(image.ID, image.Parent)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
utils.Debugf("Mounting device %s at %s for image setup", image.ID, mountDir)
|
||||
err = devices.MountDevice(image.ID, mountDir)
|
||||
if err != nil {
|
||||
_ = devices.RemoveDevice(image.ID)
|
||||
|
@ -375,14 +373,12 @@ func (image *Image) ensureImageDevice(devices DeviceSet) error {
|
|||
return err
|
||||
}
|
||||
|
||||
utils.Debugf("Applying layer %s at %s", image.ID, mountDir)
|
||||
err = image.applyLayer(layerPath(root), mountDir)
|
||||
if err != nil {
|
||||
_ = devices.RemoveDevice(image.ID)
|
||||
return err
|
||||
}
|
||||
|
||||
utils.Debugf("Unmounting %s", mountDir)
|
||||
err = syscall.Unmount(mountDir, 0)
|
||||
if err != nil {
|
||||
_ = devices.RemoveDevice(image.ID)
|
||||
|
|
|
@ -107,15 +107,15 @@ func (runtime *Runtime) GetMountMethod() MountMethod {
|
|||
if runtime.mountMethod == MountMethodNone {
|
||||
// Try to automatically pick a method
|
||||
if hasFilesystemSupport("aufs") {
|
||||
log.Printf("Using AUFS backend.")
|
||||
utils.Debugf("Using AUFS backend.")
|
||||
runtime.mountMethod = MountMethodAUFS
|
||||
} else {
|
||||
_ = exec.Command("modprobe", "aufs").Run()
|
||||
if hasFilesystemSupport("aufs") {
|
||||
log.Printf("Using AUFS backend.")
|
||||
utils.Debugf("Using AUFS backend.")
|
||||
runtime.mountMethod = MountMethodAUFS
|
||||
} else {
|
||||
log.Printf("Using device-mapper backend.")
|
||||
utils.Debugf("Using device-mapper backend.")
|
||||
runtime.mountMethod = MountMethodDeviceMapper
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue