[Checkins] SVN: Products.GenericSetup/trunk/Products/GenericSetup/ Fix utility removal so utility is not added when it is missing from the local component registry.

Laurence Rowe l at lrowe.co.uk
Fri Sep 18 11:35:57 EDT 2009


Log message for revision 104351:
  Fix utility removal so utility is not added when it is missing from the local component registry.

Changed:
  U   Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt
  U   Products.GenericSetup/trunk/Products/GenericSetup/components.py

-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt	2009-09-18 15:32:48 UTC (rev 104350)
+++ Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt	2009-09-18 15:35:57 UTC (rev 104351)
@@ -4,6 +4,9 @@
 GenericSetup 1.5.0 (unreleased)
 -------------------------------
 
+- Fix utility removal so utility is not added when it is missing from the
+  local component registry.
+
 - Fixed component handler to use 'for' not 'for_' in adapter directive. To
   support import of existing profiles 'for_' is used as a fallback.
 

Modified: Products.GenericSetup/trunk/Products/GenericSetup/components.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/components.py	2009-09-18 15:32:48 UTC (rev 104350)
+++ Products.GenericSetup/trunk/Products/GenericSetup/components.py	2009-09-18 15:35:57 UTC (rev 104351)
@@ -172,12 +172,12 @@
             factory = child.getAttribute('factory')
             factory = factory and _resolveDottedName(factory) or None
 
-            if ( child.hasAttribute('remove') and 
-                 self.context.queryUtility(provided, name) is not None ):
-                ofs_id = self._ofs_id(child)
-                if ofs_id in self.context.objectIds():
-                    self.context._delObject(ofs_id, suppress_events=True)
-                self.context.unregisterUtility(provided=provided, name=name)
+            if child.hasAttribute('remove'):
+                if self.context.queryUtility(provided, name) is not None:
+                    ofs_id = self._ofs_id(child)
+                    if ofs_id in self.context.objectIds():
+                        self.context._delObject(ofs_id, suppress_events=True)
+                    self.context.unregisterUtility(provided=provided, name=name)
                 continue
 
             if component and factory:



More information about the checkins mailing list