mirror of
https://github.com/TheGrandWazoo/freenas-proxmox.git
synced 2026-10-19 07:51:33 +02:00
Fix perlcritic: replace 'return undef' with 'return'
ProhibitExplicitReturnUndef (severity 5): returning undef explicitly is wrong because it forces scalar context on callers. 'return;' returns undef in scalar context and an empty list in list context, which is the correct idiom. Fixed all 7 occurrences in FreeNAS.pm. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
84cc862bed
commit
2430048a3d
@@ -165,7 +165,7 @@ sub run_lun_command {
|
||||
}
|
||||
|
||||
syslog("error",(caller(0))[3] . " : unknown method $method");
|
||||
return undef;
|
||||
return;
|
||||
}
|
||||
|
||||
#
|
||||
@@ -503,7 +503,7 @@ sub freenas_iscsi_get_globalconfiguration {
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error();
|
||||
return undef;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -524,7 +524,7 @@ sub freenas_iscsi_get_extent {
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error();
|
||||
return undef;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -568,7 +568,7 @@ sub freenas_iscsi_create_extent {
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error();
|
||||
return undef;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ sub freenas_iscsi_get_target {
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error();
|
||||
return undef;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -641,7 +641,7 @@ sub freenas_iscsi_get_target_to_extent {
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error();
|
||||
return undef;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -672,7 +672,7 @@ sub freenas_iscsi_create_target_to_extent {
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error();
|
||||
return undef;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user