From e27caf5c145a14b206a8495ae486e0dce245f07f Mon Sep 17 00:00:00 2001 From: Saikat Roychowdhury Date: Thu, 16 Feb 2023 06:32:23 +0000 Subject: [PATCH] test disable device path --- pkg/deviceutils/device-utils_linux.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/deviceutils/device-utils_linux.go b/pkg/deviceutils/device-utils_linux.go index 3e1cda5c4..752f08c4c 100644 --- a/pkg/deviceutils/device-utils_linux.go +++ b/pkg/deviceutils/device-utils_linux.go @@ -20,9 +20,13 @@ import ( "fmt" "os" "path/filepath" + + "k8s.io/klog/v2" ) func (_ *deviceUtils) DisableDevice(devicePath string) error { deviceName := filepath.Base(devicePath) - return os.WriteFile(fmt.Sprintf("/sys/block/%s/device/state", deviceName), []byte("offline"), 0644) + f := fmt.Sprintf("/sys/block/%s/device/state", deviceName) + klog.Infof("DisableDevice called with device path %s device name %s, target filepath %s", devicePath, deviceName, f) + return os.WriteFile(f, []byte("offline"), 0644) }