mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-14 18:07:40 +00:00
CephTools: improve abs_path error handling
verify_blockdev_path didn't check the result of abs_path causing commands like `pveceph createosd bad/path` to error with a meaningless "Use of uninitialized value" message.
This commit is contained in:
parent
735df8e5d1
commit
7fabddca05
@ -43,9 +43,11 @@ sub get_config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub verify_blockdev_path {
|
sub verify_blockdev_path {
|
||||||
my ($path) = @_;
|
my ($rel_path) = @_;
|
||||||
|
|
||||||
$path = abs_path($path);
|
die "missing path" if !$rel_path;
|
||||||
|
my $path = abs_path($rel_path);
|
||||||
|
die "failed to get absolute path to $rel_path" if !$path;
|
||||||
|
|
||||||
die "got unusual device path '$path'\n" if $path !~ m|^/dev/(.*)$|;
|
die "got unusual device path '$path'\n" if $path !~ m|^/dev/(.*)$|;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user