Changeset 5010


Ignore:
Timestamp:
23/02/09 09:27:17 (10 years ago)
Author:
cbyrom
Message:

Adjust XMLRPC client to eXist to preserve the throwing of Faults if
problems occur whilst deleting records. NB, this mainly occurs because
the record doesn't exist - but we shouldn't really be trying to delete
non-existent records, so it's probably helpful to keep this error.

Location:
ndgCommon/trunk/ndg/common
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ndgCommon/trunk/ndg/common/src/clients/xmldb/eXist/xmlrpcclient.py

    r4976 r5010  
    219219        ''' 
    220220        logging.debug("Running remove operation on '%s'" %collectionPath) 
    221         r=self.xmlrpc.removeCollection(collectionPath) 
     221        r = self.xmlrpc.removeCollection(collectionPath) 
    222222        logging.debug("Remove operation completed on '%s'" %collectionPath) 
    223223        return r 
     
    232232        ''' 
    233233        logging.debug("Running remove operation on '%s'" %docPath) 
    234         try: 
    235             r=self.xmlrpc.remove(docPath) 
    236         except xmlrpclib.Fault, f: 
    237             logging.error("Error encountered: '%s'" %f) 
    238             return False 
     234        r = self.xmlrpc.remove(docPath) 
    239235        logging.debug("Remove operation completed on '%s'" %docPath) 
    240236        return r 
  • ndgCommon/trunk/ndg/common/src/lib/utilities.py

    r4991 r5010  
    2323esc_chars = {'\xb0':'°','°':'°'} 
    2424     
    25         
     25 
    2626class edict(dict): 
    2727    '''An extended dictionary which allows one to set and get values 
  • ndgCommon/trunk/ndg/common/src/models/ndgObject.py

    r4989 r5010  
    112112            return 
    113113         
    114  
    115114        self.server=self.config.get('DISCOVERY','default') 
    116115        server=self.server 
  • ndgCommon/trunk/ndg/common/unittests/clients/xmldb/eXist/testxmlrpcclient.py

    r4978 r5010  
    11 
    2 import unittest,os 
     2import unittest,os, xmlrpclib 
    33from ndg.common.src.clients.xmldb.eXist.xmlrpcclient import * 
    44import ndg.common.src.clients.xmldb.eXist.dbconstants as dc 
     
    238238 
    239239    def testInvalidRemoveDoc(self): 
    240         self.assertFalse(self.client.removeDoc(tc.TEST_FILE_NAME)) 
     240        self.assertRaises(xmlrpclib.Fault, self.client.removeDoc, tc.TEST_FILE_NAME) 
    241241 
    242242         
Note: See TracChangeset for help on using the changeset viewer.