From 578b47b50be56abb28a262a63cc3ad0bc21a783c Mon Sep 17 00:00:00 2001 From: psc Date: Fri, 21 May 2010 12:23:56 +0000 Subject: [PATCH] Apply patch from mba for #4170 For the removal of debconf configuration use the prepare_to_save_FAI_object (which respects CoW) and fix some bugs that would have prevented its usage. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@18612 594d385d-05f5-0310-b6e9-bd551577e9d8 --- trunk/gosa-plugins/fai/admin/fai/class_FAI.inc | 2 +- trunk/gosa-plugins/fai/admin/fai/class_faiManagement.inc | 4 ++-- trunk/gosa-plugins/fai/admin/fai/class_faiPackage.inc | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/trunk/gosa-plugins/fai/admin/fai/class_FAI.inc b/trunk/gosa-plugins/fai/admin/fai/class_FAI.inc index c3005f198..2b3d1a0b5 100644 --- a/trunk/gosa-plugins/fai/admin/fai/class_FAI.inc +++ b/trunk/gosa-plugins/fai/admin/fai/class_FAI.inc @@ -613,7 +613,7 @@ class FAI /* Ldap search for fai classes specified in this release */ $ldap->cd($fai_base); - $ldap->search("(objectClass=FAIclass)",array("dn","objectClass","FAIstate")); + $ldap->search("(|(objectClass=FAIclass)(objectClass=FAIdebconfInfo))",array("dn","objectClass","FAIstate")); /* check the returned objects, and add/replace them in our return variable */ while($attr = $ldap->fetch()){ diff --git a/trunk/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/trunk/gosa-plugins/fai/admin/fai/class_faiManagement.inc index 7f40c58b6..c0114568a 100644 --- a/trunk/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/trunk/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -981,8 +981,8 @@ class faiManagement extends plugin $ldap->cd($this->dn); foreach($to_del as $dn){ /* Only delete subobjects of the current FAI class */ - $cn = $ldap->getCn($dn); - $ldap->search("cn=$cn", array('dn')); + $ldap->cd($this->dn); + $ldap->search("(|(objectClass=FAIclass)(objectClass=FAIdebconfInfo))", array('dn')); if ($ldap->count()){ while($attrs = $ldap->fetch()){ if ($attrs['dn'] == $dn) { diff --git a/trunk/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/trunk/gosa-plugins/fai/admin/fai/class_faiPackage.inc index fb7ad0902..9bf75f598 100644 --- a/trunk/gosa-plugins/fai/admin/fai/class_faiPackage.inc +++ b/trunk/gosa-plugins/fai/admin/fai/class_faiPackage.inc @@ -696,8 +696,7 @@ class faiPackage extends plugin $ldap = $this->config->get_ldap_link(); $ldap->cat($dn); if ($ldap->count()) { - $ldap->cd($dn); - $ldap->rmdir($dn); + FAI::prepare_to_save_FAI_object($dn,array(),true); } } } @@ -723,8 +722,7 @@ class faiPackage extends plugin $ldap = $this->config->get_ldap_link(); $ldap->cat($pkgdn); if ($ldap->count()) { - $ldap->cd($pkgdn); - $ldap->rmdir($pkgdn); + FAI::prepare_to_save_FAI_object($pkgdn,array(),true); } else { unset($this->ConfiguredPackages[$pkgname][$name]); -- 2.30.2