Browse Source

try to check ressources on changepackage

andre 4 years ago
parent
commit
94170497b3
1 changed files with 10 additions and 11 deletions
  1. 10 11
      app/Http/Actions/ChangePackage.php

+ 10 - 11
app/Http/Actions/ChangePackage.php

@@ -40,7 +40,6 @@ class ChangePackage extends AddonController
     use ProductService;
     use WhmcsParams;
     use HostingService;
-    use ResourceManager;
 
     /**
      * @param null $params
@@ -49,22 +48,22 @@ class ChangePackage extends AddonController
      */
     public function execute($params = null)
     {
-
-        $ressource = new ResourceManager();
-        logModuleCall(
-            'proxmoxCloud',
-            __FUNCTION__,
-            $ressource->vcpus(),
-            'Debug',
-            $ressource->memory()
-        );
-
         try {
             if(!ProxmoxAddonValidator::isInstalled()){
                 return ProxmoxAddonValidator::failAsString();
             }
             (new AppParams())->initFromWhmcsParams();
             $this->networkService = new NetworkService();
+
+            $this->ressource = new ResourceManager();
+            logModuleCall(
+                'proxmoxCloud',
+                __FUNCTION__,
+                $this->ressource->vcpus(),
+                'Debug',
+                $this->ressource->memory()
+            );
+
             //Bandwith limit
             $this->saveUsageLimit();
             //Assing ip