IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36098


Ignore:
Timestamp:
Sep 4, 2013, 4:33:23 PM (13 years ago)
Author:
heather
Message:

removes batch from both dxlayers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/dxlayer.py

    r35217 r36098  
    2525    '''
    2626    def deleteBatch(self, batchID):
     27        #HAF This is really lazy to do this way, but for the time, will check both dx layers and try the first, if no go try the second.
    2728
    2829        batch = Batch.getNameFromID(batchID)
     
    4647        p.stdout.close()
    4748
    48         if ret: self.logger.infoPair("Deleted batch from DXLayer", batch)
    49         else: self.logger.errorPair("Unable to delete batch from DXLayer", batch)
     49        if ret: self.logger.infoPair("Deleted batch from DXLayer 1", batch)
     50        else: self.logger.errorPair("Unable to delete batch from DXLayer 1" , batch)
     51
     52
     53       
     54
     55        tempFile = tempfile.NamedTemporaryFile(mode='w+b')
     56
     57        p = Popen("deleteFromDXLayer2.pl -b " + batch + " -f " + tempFile.name,
     58                shell=True,
     59                stdout=PIPE)
     60        p.wait()
     61       
     62        if p.returncode != 0:
     63           self.logger.debugPair("DXLayer webservice", "failed")
     64           return 0
     65        else:
     66           self.logger.debugPair("DXLayer webservice", "successful")
     67
     68        ret = self.decodeDXLayerResponse(tempFile.name)
     69
     70        tempFile.close()
     71        p.stdout.close()
     72
     73        if ret: self.logger.infoPair("Deleted batch from DXLayer 2", batch)
     74        else: self.logger.errorPair("Unable to delete batch from DXLayer 2" , batch)
     75
     76
     77
    5078
    5179        return ret
     80
    5281
    5382    '''
Note: See TracChangeset for help on using the changeset viewer.