Commit 04e4b134 authored by Wolfgang Bumiller's avatar Wolfgang Bumiller Committed by Dietmar Maurer

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.
parent dd55a08b
...@@ -43,9 +43,11 @@ sub get_config { ...@@ -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/(.*)$|;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment