def main(options, log): if RhicCertificate.existsAndValid(): facts = Facts(ent_dir=EntitlementDirectory(), prod_dir=ProductDirectory()) iproducts = managerlib.getInstalledProductStatus(ProductDirectory(), EntitlementDirectory(), facts.get_facts()) product_certs = [] for product in iproducts: product_certs.append(product[1]) certs = [] try: certs = rhiclib.getCerts(facts.to_dict(), product_certs) except connection.NetworkException, e: if e.code == 410: print _("RHIC was deleted by upstream server. See rhsm.log for more detail.") RhicCertificate.move() sys.exit(-1) else: raise except connection.RemoteServerException, e: if e.code == 404: print _("RHIC was not found by upstream server. See rhsm.log for more detail.") RhicCertificate.move() sys.exit(-1) else: raise
def __init__(self, lock=ActionLock(), uep=None): self.lock = lock self.uep = uep self.certlib = CertLib(self.lock, uep=self.uep) self.repolib = RepoLib(self.lock, uep=self.uep) self.factlib = FactLib(self.lock, uep=self.uep) self.profilelib = PackageProfileLib(self.lock, uep=self.uep) self.installedprodlib = InstalledProductsLib(self.lock, uep=self.uep) #healinglib requires a fact set in order to get socket count facts = Facts() self.healinglib = HealingLib(self.lock, uep=self.uep, facts_dict=facts.to_dict())