Browse Source

fix msterDisk bug

andre 4 years ago
parent
commit
46b95306d9
1 changed files with 13 additions and 4 deletions
  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();
         $hdd->delete();
         unset($this->vm);
         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;
                 continue;
             }
             }
-            if($hd['name'] == 'disk-0'){
+            if($hd->getName() == 'disk-0'){
                 continue;
                 continue;
             }
             }
-            if(preg_match('/unused/', $hd['bus'])){
+            if(preg_match('/unused/', $hd->getId())){
                 $hd->delete();
                 $hd->delete();
                 break;
                 break;
             }
             }