- Timestamp:
- Mar 5, 2012, 5:19:48 PM (14 years ago)
- Location:
- branches/meh_branches/ppstack_test
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippToPsps/jython/odm.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppstack_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/ippToPsps/jython/odm.py
r32120 r33415 2 2 3 3 import re 4 import os 5 import signal 4 6 import sys 5 7 import tempfile … … 33 35 p = Popen("../perl/checkOdmStatus.pl -b " + batch + " -f " + tempFile.name, 34 36 shell=True, 35 stdout=PIPE) 37 stdout=PIPE, 38 close_fds=True) 36 39 p.wait() 37 40 38 41 if p.returncode != 0: 39 42 self.logger.debugPair("ODM polling", "failed") … … 45 48 46 49 tempFile.close() 50 p.stdout.close() 51 47 52 48 53 if not ret: self.logger.debugPair("Cannot read ODM file for batch", "%d" % batchID) … … 58 63 59 64 loadedToODM = 0 60 loadFailed = 061 65 mergeWorthy = 0 62 66 merged = 0 … … 66 70 STATE = doc.find("{%s}OdmBatchState/{%s}BatchState" % (NAMESPACE, NAMESPACE)).text 67 71 MESSAGE = doc.find("{%s}OdmBatchState/{%s}Message" % (NAMESPACE, NAMESPACE)).text 72 results['MESSAGE'] = MESSAGE 73 results['DETAILS'] = "None" 68 74 69 if re.search("failed", STATE): loadFailed = 1 70 if re.search("MergeWorthy", MESSAGE): mergeWorthy = 1 71 if re.search("Merge[1-9]Completed", MESSAGE): merged = 1 72 if mergeWorthy or merged or loadFailed: loadedToODM = 1 75 # we assume that batches 'OnHold' are failed as it is very rare for such 76 # batches to have there state changed 77 if re.search("failed", STATE) or re.search("OnHold", MESSAGE): 78 loadedToODM = -1 79 DETAILS = doc.find("{%s}OdmBatchState/{%s}Details" % (NAMESPACE, NAMESPACE)).text 80 results['DETAILS'] = DETAILS 81 if re.search("processing", STATE): 82 loadedToODM = 1 83 if re.search("MergeWorthy", MESSAGE): 84 loadedToODM = 1 85 mergeWorthy = 1 86 if re.search("Merge[1-9]Completed", MESSAGE): 87 loadedToODM = 1 88 mergeWorthy = 1 89 merged = 1 73 90 except: 74 return 091 pass 75 92 76 93 results['LOADEDTOODM'] = loadedToODM 77 results['LOADFAILED'] = loadFailed78 94 results['MERGEWORTHY'] = mergeWorthy 79 95 results['MERGED'] = merged
Note:
See TracChangeset
for help on using the changeset viewer.
