After a iteration with the community I changed the way to invoke the method, instead of using a asynchronous call, now I can use a synchronous call. The results now came very fast, and it begins to appear on the screen the time they are processed.
This is the code to be released in the 0.3 version of the project.
def verify(self, flatten=True):
import commands, os, subprocess
ts = rpm.TransactionSet()
mi = ts.dbMatch()
results = []
for hdr in mi:
name = hdr[‘name’]
if flatten:
subprocess.call([“/bin/rpm”, “-V”, name], shell=False)
results.append(“%s” % (name))
else:
results.append([name])
return results
Advertisements
Leave a Reply