mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: log stderror when running modprobe
logging the error is not user-friendly and it contains system error message. Log the stderr which is user-friendly error message for identifying the problem. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
0311eb5f44
commit
46378f3bfc
@ -214,6 +214,7 @@ var supportedFeatures = map[string]imageFeature{
|
||||
// GetKrbdSupportedFeatures load the module if needed and return supported
|
||||
// features attribute as a string.
|
||||
func GetKrbdSupportedFeatures() (string, error) {
|
||||
var stderr string
|
||||
// check if the module is loaded or compiled in
|
||||
_, err := os.Stat(krbdSupportedFeaturesFile)
|
||||
if err != nil {
|
||||
@ -223,9 +224,9 @@ func GetKrbdSupportedFeatures() (string, error) {
|
||||
return "", err
|
||||
}
|
||||
// try to load the module
|
||||
_, _, err = util.ExecCommand(context.TODO(), "modprobe", rbdDefaultMounter)
|
||||
_, stderr, err = util.ExecCommand(context.TODO(), "modprobe", rbdDefaultMounter)
|
||||
if err != nil {
|
||||
log.ErrorLogMsg("modprobe failed: %v", err)
|
||||
log.ErrorLogMsg("modprobe failed (%v): %q", err, stderr)
|
||||
|
||||
return "", err
|
||||
}
|
||||
|
Reference in New Issue
Block a user