[Zope-Checkins] CVS: Releases/Zope/lib/python/Products/SiteAccess - VirtualHostMonster.py:1.9.6.1

Evan Simpson evan@zope.com
Wed, 11 Dec 2002 11:52:02 -0500


Update of /cvs-repository/Releases/Zope/lib/python/Products/SiteAccess
In directory cvs.zope.org:/tmp/cvs-serv23603/lib/python/Products/SiteAccess

Modified Files:
      Tag: Zope-2_6-branch
	VirtualHostMonster.py 
Log Message:
Fixed: VHM was failing on "empty" paths in the Mapping tab, such as:
myhost.com:8080/VirtualHostBase/http/myhost.com:80/


=== Releases/Zope/lib/python/Products/SiteAccess/VirtualHostMonster.py 1.9 => 1.9.6.1 ===
--- Releases/Zope/lib/python/Products/SiteAccess/VirtualHostMonster.py:1.9	Wed Aug 14 18:25:10 2002
+++ Releases/Zope/lib/python/Products/SiteAccess/VirtualHostMonster.py	Wed Dec 11 11:52:01 2002
@@ -59,13 +59,14 @@
                         while i2 < len(obpath) and obpath[i2][:4] == '_vh_':
                             i2 = i2 + 1
                         del obpath[i1:i2]
-                    try:
-                        ob = self.unrestrictedTraverse(obpath)
-                    except:
-                        raise 'LineError', 'Path not found'
-                    if not getattr(ob.aq_base, 'isAnObjectManager', 0):
-                        raise 'LineError', ('Path must lead to '
-                                            'an Object Manager')
+                    if obpath:
+                        try:
+                            ob = self.unrestrictedTraverse(obpath)
+                        except:
+                            raise 'LineError', 'Path not found'
+                        if not getattr(ob.aq_base, 'isAnObjectManager', 0):
+                            raise 'LineError', ('Path must lead to '
+                                                'an Object Manager')
                     if 'VirtualHostRoot' not in pp:
                         pp.append('/')
                     pp.reverse()