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 590844 Details for
Bug 830679
[Patch] Make rhui-manager allows valid RHUI entitlement certificates w/ extension other than ".pem"
[?]
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]
Surround X509.load_cert_string() w/ try ... except and replace try ... finally w/ with statement
0002-Surround-X509.load_cert_string-w-try-.-except-and-re.patch (text/plain), 1.64 KB, created by
Satoru SATOH
on 2012-06-11 08:20:09 UTC
(
hide
)
Description:
Surround X509.load_cert_string() w/ try ... except and replace try ... finally w/ with statement
Filename:
MIME Type:
Creator:
Satoru SATOH
Created:
2012-06-11 08:20:09 UTC
Size:
1.64 KB
patch
obsolete
>From b7b67f8ddc0ababcf7282717365aad7aae798096 Mon Sep 17 00:00:00 2001 >From: Satoru SATOH <ssato@redhat.com> >Date: Mon, 11 Jun 2012 16:54:47 +0900 >Subject: [PATCH 2/3] Surround X509.load_cert_string() w/ try ... except and > replaced try ... finally w/ with statement > >--- > src/rhui/common/certificate.py | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > >diff --git a/src/rhui/common/certificate.py b/src/rhui/common/certificate.py >index a4ff685..7b35362 100644 >--- a/src/rhui/common/certificate.py >+++ b/src/rhui/common/certificate.py >@@ -13,6 +13,8 @@ > # granted to use or replicate Red Hat trademarks that are incorporated > # in this software or its documentation. > >+#from __future__ import with_statement # if python < 2.6 >+ > """ > Contains classes for working with x.509 certificates. > The backing implementation is M2Crypto.X509 which has insufficient >@@ -45,7 +47,10 @@ class Certificate(object): > > def update(self, content): > if content: >- x509 = X509.load_cert_string(content) >+ try: >+ x509 = X509.load_cert_string(content) >+ except X509.X509Error: >+ raise # TBD > else: > x509 = X509.X509() > self.__ext = Extensions(x509) >@@ -119,12 +124,9 @@ class Certificate(object): > @return: A certificate > @rtype: L{Certificate} > """ >- f = open(path) >- content = f.read() >- try: >- self.update(content) >- finally: >- f.close() >+ with open(path) as f: >+ self.update(f.read()) >+ > self.path = path > > def write(self, path): >-- >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 830679
:
590843
| 590844 |
590845
|
590852