def finger(self,userName): methodName = 'finger' methodName = '{0} userName={1}'.format(methodName,userName) tmpLog = MsgWrapper(logger,methodName) tmpLog.info('start') try: # cleanup DN userName = parse_dn(userName) # exec tmpRet = infoClient().finger(userName) except: errtype,errvalue = sys.exc_info()[:2] errCode = self.checkError(errtype) errMsg = '{0} {1}'.format(errtype.__name__,errvalue) tmpLog.error(errMsg) return errCode,'{0}:{1}'.format(methodName,errMsg) tmpLog.info('done') return self.SC_SUCCEEDED,tmpRet
def setDatasetOwner(self,datasetName,userName): methodName = 'setDatasetOwner' methodName = '{0} datasetName={1} userName={2}'.format(methodName,datasetName,userName) tmpLog = MsgWrapper(logger,methodName) tmpLog.info('start') try: # cleanup DN userName = parse_dn(userName) # get DQ2 API dq2=DQ2() # set dq2.setMetaDataAttribute(datasetName,'owner',userName) except: errtype,errvalue = sys.exc_info()[:2] errCode = self.checkError(errtype) errMsg = '{0} {1}'.format(errtype.__name__,errvalue) tmpLog.error(errMsg) return errCode,'{0} : {1}'.format(methodName,errMsg) tmpLog.info('done') return self.SC_SUCCEEDED,True
def registerDatasetLocation(self,datasetName,location,lifetime=None,owner=None): methodName = 'registerDatasetLocation' methodName = '{0} datasetName={1} location={2}'.format(methodName,datasetName,location) tmpLog = MsgWrapper(logger,methodName) tmpLog.info('start') try: # cleanup DN owner = parse_dn(owner) # get DQ2 API dq2 = DQ2() # set dq2.registerDatasetLocation(datasetName,location,lifetime=lifetime) dq2.setReplicaMetaDataAttribute(datasetName,location,'owner',owner) except: errtype,errvalue = sys.exc_info()[:2] errCode = self.checkError(errtype) errMsg = '{0} {1}'.format(errtype.__name__,errvalue) tmpLog.error(errMsg) return errCode,'{0} : {1}'.format(methodName,errMsg) tmpLog.info('done') return self.SC_SUCCEEDED,True