[Zope-CVS] CVS: Packages/Moztop/moztopsupport/xml - container.py:1.5

Sidnei da Silva sidnei@x3ng.com.br
Fri, 21 Mar 2003 09:29:25 -0500


Update of /cvs-repository/Packages/Moztop/moztopsupport/xml
In directory cvs.zope.org:/tmp/cvs-serv26388/moztopsupport/xml

Modified Files:
	container.py 
Log Message:
A site *must* have a Local ServiceManager

=== Packages/Moztop/moztopsupport/xml/container.py 1.4 => 1.5 ===
--- Packages/Moztop/moztopsupport/xml/container.py:1.4	Fri Mar 21 08:53:52 2003
+++ Packages/Moztop/moztopsupport/xml/container.py	Fri Mar 21 09:29:24 2003
@@ -23,7 +23,8 @@
 from zope.app.content.folder import RootFolder
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
 from zope.publisher.browser import BrowserView
-from zope.component import getView, getService, getAdapter
+from zope.component import getView, getService, getAdapter, getUtility
+from moztopsupport.interfaces import IServiceManagerUtility
 
 class Config(BrowserView):
     """Displays Site Configuration in XML format"""
@@ -57,6 +58,9 @@
         return title
 
     def rsd(self):
+        smut = getUtility(self.context, IServiceManagerUtility)
+        if not smut.hasLocalServiceManager(self.context):
+            raise ComponentLookupError('Local ServiceManager could not be found')
         self.request.response.setHeader('content-type', 'text/xml')
         return self._rsd()