Piggybacking on thescouser89's answer here.
I'm not sure if this is an exhaustive list of every Yum logger, but I think it's pretty close. You can disable all of them before you start calling into Yum and it will be completely silent.
import logging
from yum.logginglevels import __NO_LOGGING
yumLoggers = ['yum.filelogging.RPMInstallCallback','yum.verbose.Repos', 'yum.verbose.plugin',
'yum.Depsolve', 'yum.verbose', 'yum.plugin', 'yum.Repos', 'yum', 'yum.verbose.YumBase',
'yum.filelogging', 'yum.verbose.YumPlugins', 'yum.RepoStorage', 'yum.YumBase',
'yum.filelogging.YumBase', 'yum.verbose.Depsolve']
for loggerName in yumLoggers:
logger = logging.getLogger(loggerName)
logger.setLevel(__NO_LOGGING)
You can also override some of the progress bars / event loggers from the various RPM transactions by making a class that inherits RPMBaseCallback and passing that into the various transaction functions (processTransaction, etc). However, if you're disabling all the loggers as I've done above, those functions will not be called.
Edit:
Upon further inspection, I think the simplest answer is: https://stackoverflow.com/a/43625141/619255
However, this approach doesn't silence warnings about incomplete transactions, while disabling all of the loggers does.