瀏覽代碼

Fix dhcp command

Espinoza Guillermo 6 年之前
父節點
當前提交
985b3aecf1
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      src/CablemodemBundle/Command/DHCPHostCRUDCommand.php

+ 5 - 5
src/CablemodemBundle/Command/DHCPHostCRUDCommand.php

@@ -121,13 +121,13 @@ EOT
             if ($hostJSON = $ws->makeGetRequest($url, HttpRequestInterface::METHOD_GET, [], $this->credentials)) {
                 $host = current(json_decode($hostJSON, true));
             }
+            if (!isset($hostId)) {
+                $this->io->error("No existe el hostType {$type} en DHCP");
+                
+                return;
+            }
         }
         
-        if (!isset($hostId)) {
-            $this->io->error("No existe el hostType {$type} en DHCP");
-            
-            return;
-        }
         
         // Creo, edito o elimino dependiendo los parámetros
         $method = HttpRequestInterface::METHOD_POST;