]> git.proxmox.com Git - pve-storage.git/commit - PVE/Diskmanage.pm
diskmanage: get_partnum: fix check
authorFabian Ebner <f.ebner@proxmox.com>
Tue, 20 Apr 2021 12:07:50 +0000 (14:07 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 20 Apr 2021 16:13:18 +0000 (18:13 +0200)
commitceb7b1ed09c4acc76496742606d1865fcf3777e5
tree1fc4d472741969a95d2168271c2ff63fa4b71023
parent415dc3985dfbd6ed6b2da73a41a3c96260eba9fd
diskmanage: get_partnum: fix check

Not replacing it with return, because the current behavior is dying:
    Can't "next" outside a loop block
and the single existing caller in pve-manager's API2/Ceph/OSD.pm does not check
the return value.

Also check for $st, which can be undefined in case a non-existing path was
provided. This also led to dying previously:
    Can't call method "mode" on an undefined value

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/Diskmanage.pm