Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 592625 Details for
Bug 833007
[Patch] fixes for cases no CDS found and some enhancements for RHUI load balancer plugin
[?]
New
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.rh83 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]
[PATCH 4/4] introduced a cached cds list file to save CDS found, and make it not trying to overwrite the cds list provided from RHUI and owned by client entitlement RPM package
0004-introduced-a-cached-cds-list-file-to-save-CDS-found-.patch (text/plain), 2.67 KB, created by
Satoru SATOH
on 2012-06-18 12:22:27 UTC
(
hide
)
Description:
[PATCH 4/4] introduced a cached cds list file to save CDS found, and make it not trying to overwrite the cds list provided from RHUI and owned by client entitlement RPM package
Filename:
MIME Type:
Creator:
Satoru SATOH
Created:
2012-06-18 12:22:27 UTC
Size:
2.67 KB
patch
obsolete
>From 61883bb3bda5558814900743b616c172d444ba68 Mon Sep 17 00:00:00 2001 >From: Satoru SATOH <ssato@redhat.com> >Date: Mon, 18 Jun 2012 19:46:32 +0900 >Subject: [PATCH 4/4] introduced a cached cds list file to save CDS found, and > make it not trying to overwrite the cds list provided > from RHUI and owned by client entitlement RPM package > >--- > etc/rhui/client-yum-plugin/rhui-lb.py | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > >diff --git a/etc/rhui/client-yum-plugin/rhui-lb.py b/etc/rhui/client-yum-plugin/rhui-lb.py >index 3407dfc..d91bccf 100644 >--- a/etc/rhui/client-yum-plugin/rhui-lb.py >+++ b/etc/rhui/client-yum-plugin/rhui-lb.py >@@ -8,6 +8,7 @@ > # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 > # along with this software; if not, see > # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. >+from __future__ import with_statement > > import httplib > import urlparse >@@ -52,7 +53,12 @@ def postreposetup_hook(conduit): > cds_list_filename = conduit.confString('main', 'cds_list_file') > std_cds_balancers = _get_lb_from_file(cds_list_filename) > >- cds_balancers = std_cds_balancers >+ cached_cds_list_file = "/var/cache/yum/rhui-load-balancers" >+ # ... or get the file path of added cds list from config as such: >+ # cached_cds_list_file = conduit.confString('main', 'cached_cds_list_file') >+ cached_cds_balancers = _get_lb_from_file(cached_cds_list_file) >+ >+ cds_balancers = std_cds_balancers + cached_cds_balancers > > if not cds_balancers: > conduit.error(0, 'No CDS load balancers found in the lists.') >@@ -78,17 +84,11 @@ def postreposetup_hook(conduit): > # We want to attempt to retain the order of the balancer list file, > # so it's not as simple as sorting them and doing an equality check. > >- # First, remove any from the local list that aren't in the new list. >- modified = [x for x in cds_balancers if x in response_balancers] >- >- # Then, add any new ones to the end of the local list. >- modified = modified + [x for x in response_balancers if x not in modified] >+ # Add any new ones to the cached local list. >+ added = [x for x in response_balancers if x not in std_cds_balancers] > >- # If any changes have been made, save to the listing file. >- if modified != cds_balancers: >- f = open(cds_list_filename, 'w') >- f.write('\n'.join(modified)) >- f.close() >+ with open(cached_cds_list_file, "w") as f: >+ f.write('\n'.join(added)) > > break > except: >-- >1.7.10.2 >
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 833007
:
592615
|
592619
|
592621
| 592625