suppress logging for 403, No_Access; strip excess path elements from baseURL
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3325 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
		
							parent
							
								
									eaad1ce9bd
								
							
						
					
					
						commit
						c5d872df6c
					
				
					 1 changed files with 16 additions and 5 deletions
				
			
		|  | @ -81,16 +81,23 @@ class BSCWConnection(object): | ||||||
|     def setURLs(self): |     def setURLs(self): | ||||||
|         url = self.getRepositoryURL() |         url = self.getRepositoryURL() | ||||||
|         if url: |         if url: | ||||||
|             self.baseURL, self.rootId = url.rsplit('/', 1) |             baseURL, self.rootId = url.rsplit('/', 1) | ||||||
|  |             self.baseURL = baseURL.split('/bscw.cgi', 1)[0] + '/bscw.cgi' | ||||||
| 
 | 
 | ||||||
|     def getItem(self, address, nested=True): |     def getItem(self, address, nested=True): | ||||||
|         try: |         try: | ||||||
|             item = self.server.get_attributes(address, standardAttributes, 1, nested) |             item = self.server.get_attributes(address, standardAttributes, 1, nested) | ||||||
|         except Fault, excp: |         except Fault, excp: | ||||||
|             logging.getLogger('cybertools.integrator.bscw').warn(str(excp)) |  | ||||||
|             item = None |             item = None | ||||||
|  |             excpInfo = str(excp) | ||||||
|  |             if "No permission: (403, 'No_Access')" in excpInfo: | ||||||
|  |                 pass | ||||||
|  |             else: | ||||||
|  |                 info = '%s - server: %s, address: %s.' % (excpInfo, self.server, address) | ||||||
|  |                 logging.getLogger('cybertools.integrator.bscw').warn(info) | ||||||
|         except Exception, excp: |         except Exception, excp: | ||||||
|             logging.getLogger('cybertools.integrator.bscw').error(str(excp)) |             info = '%s - server: %s, address: %s.' % (excpInfo, self.server, address) | ||||||
|  |             logging.getLogger('cybertools.integrator.bscw').error(info) | ||||||
|             item = None |             item = None | ||||||
|         return item |         return item | ||||||
| 
 | 
 | ||||||
|  | @ -236,10 +243,14 @@ class File(BSCWProxyBase, File): | ||||||
|         try: |         try: | ||||||
|             data = self.connection.server.get_document(self.address).data |             data = self.connection.server.get_document(self.address).data | ||||||
|         except Fault, excp: |         except Fault, excp: | ||||||
|             logging.getLogger('cybertools.integrator.bscw').warn(str(excp)) |             info = '%s - server: %s, address: %s.' % ( | ||||||
|  |                         str(excp), self.connection.server, self.address) | ||||||
|  |             logging.getLogger('cybertools.integrator.bscw').warn(info) | ||||||
|             data = '' |             data = '' | ||||||
|         except Exception, excp: |         except Exception, excp: | ||||||
|             logging.getLogger('cybertools.integrator.bscw').error(str(excp)) |             info = '%s - server: %s, address: %s.' % ( | ||||||
|  |                         str(excp), self.connection.server, self.address) | ||||||
|  |             logging.getLogger('cybertools.integrator.bscw').error(info) | ||||||
|             data = '' |             data = '' | ||||||
|         return data |         return data | ||||||
|     data = property(getData) |     data = property(getData) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 helmutm
						helmutm