Espinoza Guillermo 6 سال پیش
والد
کامیت
fdc3dbeeb5
3فایلهای تغییر یافته به همراه12 افزوده شده و 11 حذف شده
  1. 2 1
      src/KeaBundle/Command/KeaConfigCommand.php
  2. 9 9
      src/KeaBundle/Services/BaseKea.php
  3. 1 1
      src/KeaBundle/Services/KeaConfigService.php

+ 2 - 1
src/KeaBundle/Command/KeaConfigCommand.php

@@ -46,7 +46,8 @@ class KeaConfigCommand extends ContainerAwareCommand
             }
             if ($dhcp) {
                 $config = $keaConfigService->getConfig($id, $class, $library);
-                $output->writeln($keaConfigService->setConfig($dhcp, $config));
+                // $output->writeln($keaConfigService->setConfig($dhcp, $config));
+                $output->writeln($keaConfigService->saveFileConfig($config));
             } else {
                 $output->writeln("KEA DHCP id:{$id} <error>not found!</error>");
             }

+ 9 - 9
src/KeaBundle/Services/BaseKea.php

@@ -166,7 +166,7 @@ class BaseKea implements KeaConfigInterface
     private function hooksLibrariesConfig($data)
     {
         $this->hooks_libraries = [
-            /* [
+            [
                 'library' => '/opt/hooks/mysql/kea-hook-flowdat3-mysql.so',
                 'parameters' => [
                     "host" => $data['db']['host'],
@@ -174,15 +174,15 @@ class BaseKea implements KeaConfigInterface
                     "user" => $data['db']['user'],
                     "password" => $data['db']['password'],
                 ]
-            ], */
-            [
-                "library" => "/opt/hooks/amqp/kea-hook-flowdat3.so",
-                "parameters" => [
-                    "host" => $data['amqp']['host'],
-                    "user" => $data['amqp']['user'],
-                    "password" => $data['amqp']['password'],
-                ],
             ],
+            // [
+            //     "library" => "/opt/hooks/amqp/kea-hook-flowdat3.so",
+            //     "parameters" => [
+            //         "host" => $data['amqp']['host'],
+            //         "user" => $data['amqp']['user'],
+            //         "password" => $data['amqp']['password'],
+            //     ],
+            // ],
         ];
 
         $dhcp = $data['dhcp'];

+ 1 - 1
src/KeaBundle/Services/KeaConfigService.php

@@ -180,7 +180,7 @@ class KeaConfigService
         $_params = json_decode($params, true);
         if(isset($_params[0]) && isset($_params[0]['arguments'])) {
             $json = json_encode($_params[0]['arguments'], JSON_PRETTY_PRINT);
-            file_put_contents("kea/kea-dhcp4.conf", $json);
+            file_put_contents("/opt/dhcp/web/kea/kea-dhcp4.conf", $json);
 
             return true;
         }