Commit 5fc2a744 authored by Ignacio Corderi's avatar Ignacio Corderi
Browse files

Major refactoring

parent 431a67df
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@

#@author: Ignacio Corderi

# Logging
import logging
logging.basicConfig()

# Protocol version
from common import local

@@ -37,9 +41,9 @@ else:
#utils
from utils import buildRange

# client
from client import Client
from asyncclient import AsyncClient
# clients
from greenclient import Client
from secureclient import SecureClient
from threadedclient import ThreadedClient

# common
@@ -49,5 +53,7 @@ from common import Entry
# exceptions
from common import KineticMessageException

# Admin
from admin import AdminClient
# backward compatibility alliases
AsyncClient = Client
from kinetic.deprecated.adminclient import AdminClient
from kinetic import greenclient as client
 No newline at end of file

kinetic/admin/__init__.py

deleted100644 → 0
+0 −19
Original line number Diff line number Diff line
# Copyright (C) 2014 Seagate Technology.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

#@author: Ignacio Corderi

from adminclient import AdminClient
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

#@author: Ignacio Corderi

from client import Client
import deprecated
from common import Entry
import common

@@ -27,7 +27,7 @@ import threading

LOG = logging.getLogger(__name__)

class BaseAsync(Client):
class BaseAsync(deprecated.BlockingClient):

    def __init__(self, *args, **kwargs):
        super(BaseAsync, self).__init__(*args, socket_timeout=None, **kwargs)
+5 −2
Original line number Diff line number Diff line
@@ -101,6 +101,9 @@ class BaseClient(object):
    def build_socket(self, family=ss.AF_INET):
        return socket.socket(family)
       
    def wrap_secure_socket(self, s, ssl_version):
        return ssl.wrap_socket(s) #, ssl_version=ssl_version)   

    def connect(self):
        if self._socket:
            raise common.AlreadyConnected("Client is already connected.")
@@ -110,7 +113,7 @@ class BaseClient(object):
        # Stage socket on a local variable first
        s = self.build_socket(family)
        if self.use_ssl:
            s = ssl.wrap_socket(s)
            s = self.wrap_secure_socket(s, ssl.PROTOCOL_TLSv1_2)

        s.settimeout(self.connect_timeout)
        if self.socket_address:
+2 −0
Original line number Diff line number Diff line
from adminclient import AdminClient
from blockingclient import BlockingClient
 No newline at end of file
Loading