Changeset 32139
- Timestamp:
- Aug 19, 2011, 11:45:38 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/datastore.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/datastore.py
r32120 r32139 5 5 import logging 6 6 import sys 7 import re 7 8 from xml.etree.ElementTree import ElementTree, Element, tostring 8 9 … … 63 64 ''' 64 65 Removes an item from the datastore 66 67 NB this will return a success if the batch is not found on the datastore 65 68 ''' 66 69 def remove(self, name): … … 71 74 --product " + self.product 72 75 73 p = Popen(command, shell=True, stdout=PIPE )76 p = Popen(command, shell=True, stdout=PIPE, stderr=PIPE) 74 77 p.wait() 78 output, errors = p.communicate() 75 79 76 80 if p.returncode != 0: 77 self.logger.errorPair("Datastore removal failed", name) 78 ret = False 81 if re.search("not found in", errors): 82 self.logger.debugPair("Datastore batch not found", name) 83 ret = True 84 else: 85 self.logger.debugPair("Datastore removal FAILED", name) 86 ret = False 79 87 else: 88 self.logger.debugPair("Datastore removal successful", name) 80 89 ret = True 81 self.logger.infoPair("Datastore removal successful", name)82 90 83 91 return ret
Note:
See TracChangeset
for help on using the changeset viewer.
