IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33557 for trunk/ippToPsps


Ignore:
Timestamp:
Mar 16, 2012, 12:07:47 PM (14 years ago)
Author:
rhenders
Message:

try/catch around xml prettifying call; manifest creating method now returns boolean for success/failure

File:
1 edited

Legend:

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

    r33493 r33557  
    262262
    263263        # clunky way to prettify XML
    264         p = Popen("xmllint --format " + tmpPath + " > " + outPath, shell=True, stdout=PIPE)
    265         p.wait()
    266         os.remove(tmpPath)
     264        try:
     265            cmd = "xmllint --format " + tmpPath + " > " + outPath
     266            p = Popen(cmd, shell=True, stdout=PIPE)
     267            p.wait()
     268        except:
     269            self.logger.errorPair("Popen failed", cmd)
     270            return False
     271        finally:
     272            os.remove(tmpPath)
     273
     274        return True
    267275
    268276
     
    528536                self.logger.errorPair("Aborting this batch", "unable to export tables to FITS file")
    529537            else:
    530                 self.writeBatchManifest()
    531                 if self.config.datastorePublishing:
    532                     # tar and zip ready for publication to datastore
    533                     if self.tarAndZip():
    534                         # now publish to the datastore
    535                         tarballFile = Batch.getTarballFile(self.batchID)
    536                         Batch.publishToDatastore(self.datastore, self.batchID, self.batchName, self.subDir, tarballFile)
     538                if self.writeBatchManifest():
     539                    if self.config.datastorePublishing:
     540                        # tar and zip ready for publication to datastore
     541                        if self.tarAndZip():
     542                            # now publish to the datastore
     543                            tarballFile = Batch.getTarballFile(self.batchID)
     544                            Batch.publishToDatastore(
     545                                    self.datastore,
     546                                    self.batchID,
     547                                    self.batchName,
     548                                    self.subDir,
     549                                    tarballFile)
    537550
    538551from datastore import Datastore
Note: See TracChangeset for help on using the changeset viewer.