Change in vdsm[master]: janitorial: drop kaxmlrpc and unused sslutil constant

2017-06-02 Thread Code Review
From Dan Kenigsberg :

Dan Kenigsberg has posted comments on this change.

Change subject: janitorial: drop kaxmlrpc and unused sslutil constant
..


Patch Set 1: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/77686
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9e53a1a4f7017de409d7c4e4abb720196f6c76e7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Piotr Kliczewski 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org


Change in vdsm[master]: janitorial: drop kaxmlrpc and unused sslutil constant

2017-06-01 Thread Code Review
From Dan Kenigsberg :

Dan Kenigsberg has uploaded a new change for review.

Change subject: janitorial: drop kaxmlrpc and unused sslutil constant
..

janitorial: drop kaxmlrpc and unused sslutil constant

It should have been dropped together with xmlrpc in commit b3d3db.

Change-Id: I9e53a1a4f7017de409d7c4e4abb720196f6c76e7
Signed-off-by: Dan Kenigsberg 
---
M lib/vdsm/Makefile.am
D lib/vdsm/kaxmlrpclib.py
M lib/vdsm/sslutils.py
M vdsm.spec.in
4 files changed, 0 insertions(+), 151 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/77686/1

diff --git a/lib/vdsm/Makefile.am b/lib/vdsm/Makefile.am
index bcafbb1..cdcdef6 100644
--- a/lib/vdsm/Makefile.am
+++ b/lib/vdsm/Makefile.am
@@ -41,7 +41,6 @@
hugepages.py \
jobs.py \
jsonrpcvdscli.py \
-   kaxmlrpclib.py \
kvm2ovirt.py \
libvirtconnection.py \
logUtils.py \
diff --git a/lib/vdsm/kaxmlrpclib.py b/lib/vdsm/kaxmlrpclib.py
deleted file mode 100644
index 235cd57..000
--- a/lib/vdsm/kaxmlrpclib.py
+++ /dev/null
@@ -1,148 +0,0 @@
-#
-# Copyright 2008-2017 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Refer to the README and COPYING files for full details of the license
-#
-
-"""xmlrpclib with a keep-alive transport.
-
-Throws a timeout exception to the client when the underlying
-TCP transport is broken.
-
-Inspired by Volodymyr Orlenko,
-http://blog.bjola.ca/2007/08/using-timeout-with-xmlrpclib.html
-
-Sets up an xmlrpc Server with a modified Transport
-(TcpkeepTransport) which uses TcpkeepHTTPConnection when it
-needs to set up a connection.
-"""
-from __future__ import absolute_import
-from __future__ import print_function
-
-import six.moves.xmlrpc_client
-import six.moves.http_client
-import socket
-
-# It would have been nicer to make these server-specific and not module-wide
-# constants. But it is not really important for us, so it should wait.
-KEEPIDLE = 60
-KEEPINTVL = 10
-KEEPCNT = 6
-
-CONNECTTIMEOUT = 160
-
-
-def Server(url, *args, **kwargs):
-kwargs['transport'] = TcpkeepTransport()
-server = six.moves.xmlrpc_client.Server(url, *args, **kwargs)
-return server
-
-ServerProxy = Server
-
-
-class TcpkeepTransport(six.moves.xmlrpc_client.Transport):
-
-def make_connection(self, host):
-return TcpkeepHTTPConnection(host)
-
-
-class TcpkeepHTTPConnection(six.moves.http_client.HTTPConnection):
-def connect(self):
-"""Connect to the host and port specified in __init__.
-
-taken from httplib.HTTPConnection.connect(), with few additions for
-connection timeout and keep-alive
-
-after TCP_KEEPIDLE seconds of silence, TCP_KEEPCNT probes would be
-sent, TCP_KEEPINTVL seconds apart of each other. If all of them
-fail, the socket is closed."""
-
-msg = "getaddrinfo returns an empty list"
-for res in socket.getaddrinfo(self.host, self.port, 0,
-  socket.SOCK_STREAM):
-af, socktype, proto, canonname, sa = res
-try:
-self.sock = socket.socket(af, socktype, proto)
-if self.debuglevel > 0:
-print("connect: (%s, %s)" % (self.host, self.port))
-
-oldtimeout = self.sock.gettimeout()  # added
-self.sock.settimeout(CONNECTTIMEOUT)  # added
-self.sock.connect(sa)
-self.sock.settimeout(oldtimeout)   # added
-except socket.error as msg:
-if self.debuglevel > 0:
-print('connect fail:', (self.host, self.port))
-if self.sock:
-self.sock.close()
-self.sock = None
-continue
-break
-if not self.sock:
-raise socket.error(msg)
-# beginning of added code
-self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
-self.sock.setsockopt(socket.SOL_TCP, socket.TCP_KEEPIDLE, KEEPIDLE)
-self.sock.setsockopt(socket.SOL_TCP, socket.TCP_KEEPINTVL, KEEPINTVL)
-self.sock.setsockopt(socket.SOL_TCP, socket.TCP_KEEPCNT, KEEPCNT)
-# end of added code
-
-