andre 4 лет назад
Родитель
Сommit
46b95306d9
1 измененных файлов с 13 добавлено и 4 удалено
  1. 13 4
      app/UI/Disk/Providers/DiskProvider.php

+ 13 - 4
app/UI/Disk/Providers/DiskProvider.php

@@ -162,14 +162,23 @@ class DiskProvider extends BaseDataProvider implements ClientArea
         }
         $hdd->delete();
         unset($this->vm);
-        foreach($vm->getHdds() as $hd){
-            if($hd['isPrimary']){
+        foreach($vm->getHardDisks() as $hd){
+
+            logModuleCall(
+                'proxmoxCloud',
+                __FUNCTION__,
+                $hd->getName(),
+                'Debug',
+                $hd->getId()
+            );
+            
+            if($hd->isMaster()){
                 continue;
             }
-            if($hd['name'] == 'disk-0'){
+            if($hd->getName() == 'disk-0'){
                 continue;
             }
-            if(preg_match('/unused/', $hd['bus'])){
+            if(preg_match('/unused/', $hd->getId())){
                 $hd->delete();
                 break;
             }