Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
parent
3b068ebe39
commit
18180bfabf
15 changed files with 80 additions and 80 deletions
|
@ -9,7 +9,7 @@ import (
|
|||
"runtime"
|
||||
"syscall"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/Sirupsen/logrus"
|
||||
)
|
||||
|
||||
type DevmapperLogger interface {
|
||||
|
@ -237,7 +237,7 @@ func (t *Task) GetNextTarget(next uintptr) (nextPtr uintptr, start uint64,
|
|||
func getLoopbackBackingFile(file *os.File) (uint64, uint64, error) {
|
||||
loopInfo, err := ioctlLoopGetStatus64(file.Fd())
|
||||
if err != nil {
|
||||
log.Errorf("Error get loopback backing file: %s", err)
|
||||
logrus.Errorf("Error get loopback backing file: %s", err)
|
||||
return 0, 0, ErrGetLoopbackBackingFile
|
||||
}
|
||||
return loopInfo.loDevice, loopInfo.loInode, nil
|
||||
|
@ -245,7 +245,7 @@ func getLoopbackBackingFile(file *os.File) (uint64, uint64, error) {
|
|||
|
||||
func LoopbackSetCapacity(file *os.File) error {
|
||||
if err := ioctlLoopSetCapacity(file.Fd(), 0); err != nil {
|
||||
log.Errorf("Error loopbackSetCapacity: %s", err)
|
||||
logrus.Errorf("Error loopbackSetCapacity: %s", err)
|
||||
return ErrLoopbackSetCapacity
|
||||
}
|
||||
return nil
|
||||
|
@ -285,7 +285,7 @@ func FindLoopDeviceFor(file *os.File) *os.File {
|
|||
|
||||
func UdevWait(cookie uint) error {
|
||||
if res := DmUdevWait(cookie); res != 1 {
|
||||
log.Debugf("Failed to wait on udev cookie %d", cookie)
|
||||
logrus.Debugf("Failed to wait on udev cookie %d", cookie)
|
||||
return ErrUdevWait
|
||||
}
|
||||
return nil
|
||||
|
@ -305,7 +305,7 @@ func LogInit(logger DevmapperLogger) {
|
|||
|
||||
func SetDevDir(dir string) error {
|
||||
if res := DmSetDevDir(dir); res != 1 {
|
||||
log.Debugf("Error dm_set_dev_dir")
|
||||
logrus.Debugf("Error dm_set_dev_dir")
|
||||
return ErrSetDevDir
|
||||
}
|
||||
return nil
|
||||
|
@ -348,8 +348,8 @@ func CookieSupported() bool {
|
|||
|
||||
// Useful helper for cleanup
|
||||
func RemoveDevice(name string) error {
|
||||
log.Debugf("[devmapper] RemoveDevice START(%s)", name)
|
||||
defer log.Debugf("[devmapper] RemoveDevice END(%s)", name)
|
||||
logrus.Debugf("[devmapper] RemoveDevice START(%s)", name)
|
||||
defer logrus.Debugf("[devmapper] RemoveDevice END(%s)", name)
|
||||
task, err := TaskCreateNamed(DeviceRemove, name)
|
||||
if task == nil {
|
||||
return err
|
||||
|
@ -375,7 +375,7 @@ func RemoveDevice(name string) error {
|
|||
func GetBlockDeviceSize(file *os.File) (uint64, error) {
|
||||
size, err := ioctlBlkGetSize64(file.Fd())
|
||||
if err != nil {
|
||||
log.Errorf("Error getblockdevicesize: %s", err)
|
||||
logrus.Errorf("Error getblockdevicesize: %s", err)
|
||||
return 0, ErrGetBlockSize
|
||||
}
|
||||
return uint64(size), nil
|
||||
|
@ -494,21 +494,21 @@ func GetDriverVersion() (string, error) {
|
|||
func GetStatus(name string) (uint64, uint64, string, string, error) {
|
||||
task, err := TaskCreateNamed(DeviceStatus, name)
|
||||
if task == nil {
|
||||
log.Debugf("GetStatus: Error TaskCreateNamed: %s", err)
|
||||
logrus.Debugf("GetStatus: Error TaskCreateNamed: %s", err)
|
||||
return 0, 0, "", "", err
|
||||
}
|
||||
if err := task.Run(); err != nil {
|
||||
log.Debugf("GetStatus: Error Run: %s", err)
|
||||
logrus.Debugf("GetStatus: Error Run: %s", err)
|
||||
return 0, 0, "", "", err
|
||||
}
|
||||
|
||||
devinfo, err := task.GetInfo()
|
||||
if err != nil {
|
||||
log.Debugf("GetStatus: Error GetInfo: %s", err)
|
||||
logrus.Debugf("GetStatus: Error GetInfo: %s", err)
|
||||
return 0, 0, "", "", err
|
||||
}
|
||||
if devinfo.Exists == 0 {
|
||||
log.Debugf("GetStatus: Non existing device %s", name)
|
||||
logrus.Debugf("GetStatus: Non existing device %s", name)
|
||||
return 0, 0, "", "", fmt.Errorf("Non existing device %s", name)
|
||||
}
|
||||
|
||||
|
@ -567,7 +567,7 @@ func ResumeDevice(name string) error {
|
|||
}
|
||||
|
||||
func CreateDevice(poolName string, deviceId int) error {
|
||||
log.Debugf("[devmapper] CreateDevice(poolName=%v, deviceId=%v)", poolName, deviceId)
|
||||
logrus.Debugf("[devmapper] CreateDevice(poolName=%v, deviceId=%v)", poolName, deviceId)
|
||||
task, err := TaskCreateNamed(DeviceTargetMsg, poolName)
|
||||
if task == nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue