def posttrans_hook(conduit): """ Update product ID certificates. """ # register rpm name for yum history recording # yum on 5.7 doesn't have this method, so check for it if hasattr(conduit, 'registerPackageName'): conduit.registerPackageName("subscription-manager") logutil.init_logger_for_yum() chroot() try: pm = ProductManager() pm.update(conduit._base) conduit.info(3, 'Installed products updated.') except Exception, e: conduit.error(3, str(e))
def __init__(self, base): self.base = base ProductManager.__init__(self)
requires_api_version = '2.6' plugin_type = (TYPE_CORE, ) def posttrans_hook(conduit): """ Update product ID certificates. """ # register rpm name for yum history recording # yum on 5.7 doesn't have this method, so check for it if hasattr(conduit, 'registerPackageName'): conduit.registerPackageName("subscription-manager") try: from subscription_manager.injectioninit import init_dep_injection init_dep_injection() except ImportError, e: conduit.error(3, str(e)) return logutil.init_logger_for_yum() # If a tool (it's, e.g., Anaconda and Mock) manages a chroot via # 'yum --installroot', we must update certificates in that directory. chroot(conduit.getConf().installroot) try: pm = ProductManager() pm.update(conduit._base) conduit.info(3, 'Installed products updated.') except Exception, e: conduit.error(3, str(e))
anaconda_pid = "/var/run/anaconda.pid" if os.path.exists(sysimage) and os.path.exists(anaconda_pid): Path.ROOT = sysimage def posttrans_hook(conduit): """ Update product ID certificates. """ # register rpm name for yum history recording # yum on 5.7 doesn't have this method, so check for it if hasattr(conduit, "registerPackageName"): conduit.registerPackageName("subscription-manager") try: from subscription_manager.injectioninit import init_dep_injection init_dep_injection() except ImportError, e: conduit.error(3, str(e)) return logutil.init_logger_for_yum() chroot() try: pm = ProductManager() pm.update(conduit._base) conduit.info(3, "Installed products updated.") except Exception, e: conduit.error(3, str(e))