Code

Updated Device config, to use the correct config management method
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 May 2011 12:04:26 +0000 (12:04 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 May 2011 12:04:26 +0000 (12:04 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20846 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Device/InstallRecipe.tpl
gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc
gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc

index ba2fa34ffc8b43c4d83784e2813c939712e3dad8..096d14cbe4a8890c59eb8343438d17e327ce49a7 100644 (file)
@@ -25,7 +25,7 @@
                 <tr>
                     <td><LABEL for="installConfigManagement">{t}Config management{/t}</LABEL></td>
                     <td>
-                        <select nme="installConfigManagement" size=1 onChange='document.mainform.submit();'>
+                        <select name="installConfigManagement" size=1 onChange='document.mainform.submit();'>
                             {html_options options=$installConfigManagementList 
                             selected=$installConfigManagement}
                         </select>
index c77adbd336a1dcaa24bc9ec9a7aa84b24fc3aba7..208b7fa8c945e031601ad50c79d0103bb37aa00e 100644 (file)
@@ -89,9 +89,11 @@ class DeviceConfig extends plugin
                 $smarty->assign("errorMsg", msgPool::rpcError($this->rpcErrorMessage));
                 return($display.$smarty->fetch(get_template_path('goto/Device/DeviceConfig.tpl', TRUE)));
             }
-            
+           
             // Load assignable elements.
-            $assignableElements = $rpc->listAssignableElements('squeeze/1.0');
+            $release = $this->parent->by_object['InstallRecipe']->installRelease;
+            $assignableElements = $rpc->listAssignableElements($release);
             if(!$rpc->success()){
                 $smarty = get_smarty();
                 $smarty->assign("error", TRUE);
@@ -265,7 +267,9 @@ class DeviceConfig extends plugin
 
         // Save changes back to server.
         $rpc = $this->config->getRpcHandle();
-        $rpc->systemSetConfigParameters($this->deviceUUID, array('method' => 'puppet', 'var' => $save, 'item' => $this->usedElements));
+        $installConfigManagement = $this->parent->by_object['InstallRecipe']->installConfigManagement;
+        $rpc->systemSetConfigParameters($this->deviceUUID, array('method' => $installConfigManagement, 
+                    'var' => $save, 'item' => $this->usedElements));
         if(!$rpc->success()){
             $this->rpcErrorMessage = $rpc->get_error();
             msg_dialog::display(_("Error"), msgPool::rpcError($this->rpcErrorMessage), ERROR_DIALOG);
index 7f8b7d67c5598f3d293ab50c85c32b061224c9f1..b5ccec7a208a48c8323fcb182a6039cc561e0c9d 100644 (file)
@@ -152,6 +152,11 @@ class InstallRecipe extends plugin
         $this->installBootstrapMethod = $this->installationTemplates[$this->installTemplate]['method'];
         $this->reloadInstallationKernelPackages($initially);
         $this->reloadInstallationMirrors($initially);
+
+        // Preset the config management method.
+        if(!isset($this->installConfigManagementList[$this->installBootstrapMethod][$this->installConfigManagement])){
+            $this->installConfigManagement = key($this->installConfigManagementList[$this->installBootstrapMethod]);
+        }
     }