Bug 668208 - func unable to perform actions with python2.7 and xmlrpclib
Summary: func unable to perform actions with python2.7 and xmlrpclib
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: func
Version: 14
Hardware: noarch
OS: Linux
low
medium
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-09 00:50 UTC by Clint Savage
Modified: 2014-01-21 23:17 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-16 22:36:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Clint Savage 2011-01-09 00:50:04 UTC
Description of problem:

During invocation of a simple func call, I receive error "HTTPS instance has no attribute 'getresponse'"


Version-Release number of selected component (if applicable):

func-0.27-1.fc14.noarch
certmaster-0.27-1.fc14.noarch

How reproducible:

Simply running 'func <HOST> call system ls' causes the error.

Steps to Reproduce:
1. yum install func-0.27-1 (certmaster will automatically install)
2. service certmaster start
3. service funcd start
4. func <HOST> call system ls
  
Actual results:

{'<HOST>': ['REMOTE_ERROR',
                     'exceptions.AttributeError',
                     "HTTPS instance has no attribute 'getresponse'",
                     '  File "/usr/lib/python2.7/site-packages/func/overlord/client.py", line 860, in process_server\n    retval = getattr(conn, meth)(*args[:])\n   File "/usr/lib64/python2.7/xmlrpclib.py", line 1224, in __call__\n    return self.__send(self.__name, args)\n   File "/usr/lib64/python2.7/xmlrpclib.py", line 1570, in __request\n    verbose=self.__verbose\n   File "/usr/lib64/python2.7/xmlrpclib.py", line 1264, in request\n    return self.single_request(host, handler, request_body, verbose)\n   File "/usr/lib64/python2.7/xmlrpclib.py", line 1294, in single_request\n    response = h.getresponse(buffering=True)\n']}

Expected results:

Return results of 'ls' command on <HOST>

Additional info:

Comment 1 Ricky Zhou 2011-01-09 01:06:14 UTC
Clint found bug #619276 which seems to be the exact same issue for koji (these seem to be python 2.7 compat issues).

The SSLConnection.py patch at https://fedorahosted.org/koji/changeset/7876bc06fe9151fb521409c2e8f6a3535e1eacfe should be applied to SSLConnection.py in certmaster in order to properly emulate the socket interface.

To get func running, I also needed to replace SSLCommon.HTTPS with SSLCommon.HTTPSConnection in func/overlord/sslclient.py.  I'm not sure how this affects compatibility for python <2.7 - perhaps there are some hints about this in the koji bug.

Comment 2 Ricky Zhou 2011-01-09 01:13:10 UTC
This is the equivalent patch to the koji/ssl/XMLRPCServerProxy.py patch applied to koji:

diff --git a/func/overlord/sslclient.py b/func/overlord/sslclient.py
index 16bd40f..3f49e1a 100644
--- a/func/overlord/sslclient.py
+++ b/func/overlord/sslclient.py
@@ -23,7 +23,11 @@ class SSL_Transport(xmlrpclib.Transport):
             # Yay for Python 2.2
             pass
         _host, _port = urllib.splitport(host)
-        return SSLCommon.HTTPS(_host, int(_port), ssl_context=self.ssl_ctx, timeout=self._timeout)
+        if hasattr(xmlrpclib.Transport, 'single_request'):
+            cnx_class = SSLCommon.HTTPSConnection
+        else:
+            cnx_class = SSLCommon.HTTPS
+        return cnx_class(_host, int(_port), ssl_context=self.ssl_ctx, timeout=self._timeout)
 
 
 class SSLXMLRPCServerProxy(xmlrpclib.ServerProxy):

Comment 3 David Ward 2011-03-04 20:42:43 UTC
Fix works for me.  Was applied to func upstream:  https://fedorahosted.org/func/changeset/aa95dc473df1ac987dee1aefe4c8947e4eb00d50

@Seth: please create a package in updates-testing with this patch.

Comment 4 David Ward 2011-03-04 22:05:39 UTC
Also, this corresponding changeset needs to be applied to certmaster, and a new certmaster package needs to be created in updates-testing as well:
https://fedorahosted.org/certmaster/changeset/c11b1babbe56144f39212e4b453c4519e0521ca6

Comment 5 seth vidal 2011-04-11 15:12:04 UTC
updates-testing now has a pkg for certmaster and func which, I believe, handles this. I know that both are working on f14/python 2.7

Comment 6 Nathanael Noblet 2011-11-17 02:49:00 UTC
this bug affects fedora F15 - func-0.27-2.fc15.noarch

Comment 7 Konstantin Ryabitsev 2012-02-15 23:49:30 UTC
Seconded on it not working on F15.

Comment 8 Fedora End Of Life 2012-08-16 22:36:08 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


Note You need to log in before you can comment on or make changes to this bug.