]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
use correct info on disks in destroyosd and skip smart
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 5 Oct 2016 13:32:40 +0000 (15:32 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 6 Oct 2016 06:27:46 +0000 (08:27 +0200)
instead of using
'/dev/${real_dev}'

we use the devpath property directly

also we skip the smart check in the cleanup

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/API2/Ceph.pm

index 030664aa92fbe6b99df00d7f9f24c186c48265fa..7b1bbd00496c10b5cb545d492d890694c66b84a5 100644 (file)
@@ -330,11 +330,12 @@ __PACKAGE__->register_method ({
                   
                foreach my $real_dev (keys %$disklist) {
                    my $diskinfo = $disklist->{$real_dev};
+                   my $devpath = $diskinfo->{devpath};
                    next if !$diskinfo->{gpt};
-                   if ($part =~ m|^/dev/${real_dev}(\d+)$|) {
+                   if ($part =~ m|^${devpath}(\d+)$|) {
                        my $partnum = $1;
-                       print "remove partition $part (disk '/dev/${real_dev}', partnum $partnum)\n";
-                       eval { run_command(['/sbin/sgdisk', '-d', $partnum, "/dev/${real_dev}"]); };
+                       print "remove partition $part (disk '${devpath}', partnum $partnum)\n";
+                       eval { run_command(['/sbin/sgdisk', '-d', $partnum, "${devpath}"]); };
                        warn $@ if $@;
                        last;
                    }
@@ -367,7 +368,7 @@ __PACKAGE__->register_method ({
            if (my $err = $@) {
                warn $err;
            } elsif ($param->{cleanup}) {
-               my $disklist = PVE::Diskmanage::get_disks();
+               my $disklist = PVE::Diskmanage::get_disks(undef, 1);
                &$remove_partition($disklist, $journal_part);
                &$remove_partition($disklist, $data_part);
            }