Write a list of installed packages to /root/lorax-packages.log (#1416155)

This can't be done the same way as on master because there is no rpm
database inside the installroot to run rpm -qa against. Do it at the end
of the yum transaction.

Resolves: rhbz#1416155
This commit is contained in:
Brian C. Lane 2017-08-08 11:24:30 -07:00
parent 1639df6862
commit 54d973e059
1 changed files with 5 additions and 0 deletions

View File

@ -518,6 +518,11 @@ class LoraxTemplateRunner(object):
for po in errs:
logger.error("package '%s' was not installed", po)
# Write the manifest of installed files to /root/lorax-packages.log
with open(self._out("root/lorax-packages.log"), "w") as f:
for t in sorted(self.yum.tsInfo):
f.write("%s\n" % t.po)
self.yum.closeRpmDB()
def removefrom(self, pkg, *globs):