Example #1
0
 def setContainerPath(self, path=None):
     """ """
     if not path:
         self.obpath = None  # undefined state
     elif type(path) is type(''):
         if bad_path_chars_in(path):
             raise SessionDataManagerErr(
                 'Container path contains characters invalid in a Zope '
                 'object path')
         self.obpath = path.split('/')
     elif type(path) in (type([]), type(())):
         self.obpath = list(path)  # sequence
     else:
         raise SessionDataManagerErr('Bad path value %s' % path)
Example #2
0
 def getBrowserIdManager(self):
     """ """
     mgr = getattr(self, BROWSERID_MANAGER_NAME, None)
     if mgr is None:
         raise SessionDataManagerErr(
             'No browser id manager named %s could be found.' %
             BROWSERID_MANAGER_NAME)
     return mgr
Example #3
0
 def _getSessionDataContainer(self):
     """ Do not cache the results of this call.  Doing so breaks the
     transactions for mounted storages. """
     if self.obpath is None:
         err = 'Session data container is unspecified in %s' % self.getId()
         LOG.warn(err)
         raise SessionIdManagerErr(err)
     try:
         # This should arguably use restrictedTraverse, but it
         # currently fails for mounted storages.  This might
         # be construed as a security hole, albeit a minor one.
         # unrestrictedTraverse is also much faster.
         # hasattr hides conflicts
         if DEBUG and not getattr(self, '_v_wrote_dc_type', None):
             args = '/'.join(self.obpath)
             LOG.debug('External data container at %s in use' % args)
             self._v_wrote_dc_type = 1
         return self.unrestrictedTraverse(self.obpath)
     except ConflictError:
         raise
     except:
         raise SessionDataManagerErr(
             "External session data container '%s' not found." %
             '/'.join(self.obpath))