Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 524931 Details for
Bug 741335
changes to allow auto-healing from rhsmcertd
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
actual approved changes
0001-heal-for-today-and-future.patch (text/plain), 3.12 KB, created by
Jesus M. Rodriguez
on 2011-09-26 15:46:19 UTC
(
hide
)
Description:
actual approved changes
Filename:
MIME Type:
Creator:
Jesus M. Rodriguez
Created:
2011-09-26 15:46:19 UTC
Size:
3.12 KB
patch
obsolete
>From 9ad7e563a4322c1db2658ee69f3dfce53c1585f3 Mon Sep 17 00:00:00 2001 >From: jesus m. rodriguez <jesusr@redhat.com> >Date: Tue, 20 Sep 2011 13:18:48 -0400 >Subject: [PATCH] heal for today and future > >find_first_invalid_date returns today or some date in the future. If the >date is beyond tomorrow, we're good for a little while longer, nothing >to do. Otherwise, we either are or will be unentitled soon, in which >case we should heal ourselves. >--- > src/subscription_manager/certlib.py | 46 ++++++++++++++++++++++++++-------- > 1 files changed, 35 insertions(+), 11 deletions(-) > >diff --git a/src/subscription_manager/certlib.py b/src/subscription_manager/certlib.py >index 78ee2f0..c40e0d7 100644 >--- a/src/subscription_manager/certlib.py >+++ b/src/subscription_manager/certlib.py >@@ -106,20 +106,44 @@ class HealingLib(DataLib): > from subscription_manager import managerlib > cs = cert_sorter.CertSorter(ProductDirectory(), EntitlementDirectory(), > facts_dict=self.facts_dict) >- if (len(cs.partially_valid_products) + len(cs.unentitled_products) >- + len(cs.expired_products)) == 0: >- log.debug("System does not require healing") >- return 0 >- elif 'autoheal' in consumer and consumer['autoheal']: >+ >+ >+ if 'autoheal' in consumer and consumer['autoheal']: > try: >+ >+ today = datetime.now(GMT()) >+ tomorrow = today + timedelta(days=1) >+ >+ # >+ # find_first_invalid_date returns today or some date in the >+ # future. If the date is beyond tomorrow, we're good for a >+ # little while longer, nothing to do. Otherwise, we either are >+ # or will be unentitled soon, in which case we should heal >+ # ourselves. >+ # >+ expiring_date = find_first_invalid_date() >+ >+ log.debug("Expiring date: %s, Today: %s, Tomorrow: %s" % ( >+ str(expiring_date), str(today), str(tomorrow))) >+ >+ if expiring_date is None or expiring_date >= tomorrow: >+ log.debug("System does not require healing") >+ return 0 >+ >+ # >+ # Otherwise, expiring_date <= tomorrow we should >+ # try to heal. >+ # >+ > log.info("Attempting to auto-heal the system.") >- # TODO: repeat this routine for both today's date, and >- # tomorrow's, so if subs are available we'll never be out of >- # compliance. > >- # TODO: check compliance status here, and don't proceed if >- # we're already compliant. >- self.uep.bind(uuid) >+ # >+ # we're already unentitled, better heal ourselves >+ # >+ if expiring_date <= today: >+ self.uep.bind(uuid, today) >+ else: >+ self.uep.bind(uuid, tomorrow) > except Exception, e: > log.error("Error attempting to auto-heal:") > log.exception(e) >-- >1.7.3.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 741335
: 524931 |
527305