소스 검색

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;