Commit 4fcd8ddc authored by Vincent Pelletier's avatar Vincent Pelletier

Drop some unused imports.

parent e738b9a0
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
from neo.lib import logging, protocol from neo.lib import logging, protocol
from neo.lib.handler import EventHandler from neo.lib.handler import EventHandler
from neo.lib.protocol import uuid_str, Packets, Errors from neo.lib.protocol import uuid_str, Packets
from neo.lib.exception import PrimaryFailure from neo.lib.exception import PrimaryFailure
def check_primary_master(func): def check_primary_master(func):
......
...@@ -20,8 +20,6 @@ import ZODB.interfaces ...@@ -20,8 +20,6 @@ import ZODB.interfaces
from functools import wraps from functools import wraps
from neo.lib import logging from neo.lib import logging
from neo.lib.util import add64
from neo.lib.protocol import ZERO_TID
from .app import Application from .app import Application
from .exception import NEOStorageNotFoundError, NEOStorageDoesNotExistError from .exception import NEOStorageNotFoundError, NEOStorageDoesNotExistError
......
...@@ -20,7 +20,6 @@ from neo.lib.locking import Empty ...@@ -20,7 +20,6 @@ from neo.lib.locking import Empty
from random import shuffle from random import shuffle
import heapq import heapq
import time import time
import os
from ZODB.POSException import UndoError, StorageTransactionError, ConflictError from ZODB.POSException import UndoError, StorageTransactionError, ConflictError
from ZODB.POSException import ReadConflictError from ZODB.POSException import ReadConflictError
...@@ -38,7 +37,6 @@ from neo.lib.node import NodeManager ...@@ -38,7 +37,6 @@ from neo.lib.node import NodeManager
from neo.lib.connector import getConnectorHandler from neo.lib.connector import getConnectorHandler
from .exception import NEOStorageError, NEOStorageCreationUndoneError from .exception import NEOStorageError, NEOStorageCreationUndoneError
from .exception import NEOStorageNotFoundError from .exception import NEOStorageNotFoundError
from neo.lib.exception import NeoException
from .handlers import storage, master from .handlers import storage, master
from neo.lib.dispatcher import Dispatcher, ForgottenPacket from neo.lib.dispatcher import Dispatcher, ForgottenPacket
from .poll import ThreadedPoll, psThreadedPoll from .poll import ThreadedPoll, psThreadedPoll
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
from neo.lib import logging from neo.lib import logging
from neo.lib.pt import MTPartitionTable as PartitionTable from neo.lib.pt import MTPartitionTable as PartitionTable
from neo.lib.protocol import NodeTypes, NodeStates, Packets, ProtocolError from neo.lib.protocol import NodeStates, Packets, ProtocolError
from neo.lib.util import dump from neo.lib.util import dump
from . import BaseHandler, AnswerBaseHandler from . import BaseHandler, AnswerBaseHandler
from ..exception import NEOStorageError from ..exception import NEOStorageError
......
...@@ -18,7 +18,7 @@ from ZODB.TimeStamp import TimeStamp ...@@ -18,7 +18,7 @@ from ZODB.TimeStamp import TimeStamp
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
from neo.lib import logging from neo.lib import logging
from neo.lib.protocol import NodeTypes, ProtocolError, LockState, ZERO_TID from neo.lib.protocol import LockState, ZERO_TID
from neo.lib.util import dump from neo.lib.util import dump
from neo.lib.exception import NodeNotReady from neo.lib.exception import NodeNotReady
from . import BaseHandler, AnswerBaseHandler from . import BaseHandler, AnswerBaseHandler
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from ZODB import BaseStorage from ZODB import BaseStorage
from zope.interface import implements
import ZODB.interfaces
from neo.lib.util import u64, add64 from neo.lib.util import u64, add64
from .exception import NEOStorageCreationUndoneError, NEOStorageNotFoundError from .exception import NEOStorageCreationUndoneError, NEOStorageNotFoundError
......
...@@ -14,10 +14,9 @@ ...@@ -14,10 +14,9 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from functools import wraps
from . import logging from . import logging
from .protocol import ( from .protocol import (
NodeStates, Packets, ErrorCodes, Errors, BrokenNodeDisallowedError, NodeStates, Packets, Errors, BrokenNodeDisallowedError,
NotReadyError, PacketMalformedError, ProtocolError, UnexpectedPacketError) NotReadyError, PacketMalformedError, ProtocolError, UnexpectedPacketError)
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
from collections import deque from collections import deque
from functools import wraps from functools import wraps
from logging import getLogger, Formatter, Logger, LogRecord, StreamHandler, \ from logging import getLogger, Formatter, Logger, StreamHandler, \
DEBUG, WARNING DEBUG, WARNING
from time import time from time import time
from traceback import format_exception from traceback import format_exception
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
import socket import socket
import sys import sys
import traceback import traceback
from socket import inet_ntoa, inet_aton
from cStringIO import StringIO from cStringIO import StringIO
from struct import Struct from struct import Struct
try: try:
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import re
import socket import socket
from binascii import a2b_hex, b2a_hex from binascii import a2b_hex, b2a_hex
from hashlib import sha1 from hashlib import sha1
......
...@@ -14,20 +14,19 @@ ...@@ -14,20 +14,19 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import os, sys, weakref import sys, weakref
from time import time from time import time
from neo.lib import logging from neo.lib import logging
from neo.lib.connector import getConnectorHandler from neo.lib.connector import getConnectorHandler
from neo.lib.debug import register as registerLiveDebugger from neo.lib.debug import register as registerLiveDebugger
from neo.lib.protocol import uuid_str, UUID_NAMESPACES, ZERO_TID, NotReadyError from neo.lib.protocol import uuid_str, UUID_NAMESPACES, ZERO_TID
from neo.lib.protocol import ClusterStates, NodeStates, NodeTypes, Packets from neo.lib.protocol import ClusterStates, NodeStates, NodeTypes, Packets
from neo.lib.node import NodeManager from neo.lib.node import NodeManager
from neo.lib.event import EventManager from neo.lib.event import EventManager
from neo.lib.handler import EventHandler from neo.lib.handler import EventHandler
from neo.lib.connection import ListeningConnection, ClientConnection from neo.lib.connection import ListeningConnection, ClientConnection
from neo.lib.exception import ElectionFailure, PrimaryFailure, OperationFailure from neo.lib.exception import ElectionFailure, PrimaryFailure, OperationFailure
from neo.lib.util import dump
class StateChangedException(Exception): pass class StateChangedException(Exception): pass
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
from neo.lib.exception import PrimaryFailure from neo.lib.exception import PrimaryFailure
from neo.lib.handler import EventHandler from neo.lib.handler import EventHandler
from neo.lib.protocol import CellStates, ZERO_TID from neo.lib.protocol import ZERO_TID
class BackupHandler(EventHandler): class BackupHandler(EventHandler):
"""Handler dedicated to upstream master during BACKINGUP state""" """Handler dedicated to upstream master during BACKINGUP state"""
......
...@@ -14,11 +14,8 @@ ...@@ -14,11 +14,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import neo.lib
from neo.lib.protocol import NodeStates, Packets, ProtocolError from neo.lib.protocol import NodeStates, Packets, ProtocolError
from neo.lib.util import dump
from . import MasterHandler from . import MasterHandler
from ..transactions import DelayedError
class ClientServiceHandler(MasterHandler): class ClientServiceHandler(MasterHandler):
""" Handler dedicated to client during service state """ """ Handler dedicated to client during service state """
......
...@@ -15,9 +15,8 @@ ...@@ -15,9 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from neo.lib import logging from neo.lib import logging
from neo.lib.protocol import uuid_str, NodeTypes, NodeStates, Packets from neo.lib.protocol import uuid_str, NodeTypes, Packets
from neo.lib.protocol import NotReadyError, ProtocolError, \ from neo.lib.protocol import NotReadyError
UnexpectedPacketError
from neo.lib.exception import ElectionFailure from neo.lib.exception import ElectionFailure
from neo.lib.handler import EventHandler from neo.lib.handler import EventHandler
from . import MasterHandler from . import MasterHandler
......
...@@ -14,9 +14,8 @@ ...@@ -14,9 +14,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import neo
from neo.lib import logging from neo.lib import logging
from neo.lib.protocol import ClusterStates, NodeStates, NodeTypes, Packets, \ from neo.lib.protocol import ClusterStates, NodeStates, NodeTypes, \
NotReadyError, ProtocolError, uuid_str NotReadyError, ProtocolError, uuid_str
from . import MasterHandler from . import MasterHandler
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
from neo.lib import logging from neo.lib import logging
from neo.lib.protocol import CellStates, ClusterStates, Packets, ProtocolError from neo.lib.protocol import CellStates, ClusterStates, Packets, ProtocolError
from neo.lib.exception import OperationFailure from neo.lib.exception import OperationFailure
from neo.lib.util import dump
from neo.lib.connector import ConnectorConnectionClosedException
from neo.lib.pt import PartitionTableException from neo.lib.pt import PartitionTableException
from . import BaseServiceHandler from . import BaseServiceHandler
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import neo.lib.pt import neo.lib.pt
from struct import pack, unpack
from neo.lib.protocol import CellStates, ZERO_TID from neo.lib.protocol import CellStates, ZERO_TID
......
...@@ -14,12 +14,10 @@ ...@@ -14,12 +14,10 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from struct import pack
from neo.lib import logging from neo.lib import logging
from neo.lib.util import dump from neo.lib.util import dump
from neo.lib.protocol import Packets, ProtocolError, ClusterStates, NodeStates from neo.lib.protocol import Packets, ProtocolError, ClusterStates, NodeStates
from neo.lib.protocol import NotReadyError, ZERO_OID, ZERO_TID from neo.lib.protocol import ZERO_OID
from .handlers import MasterHandler from .handlers import MasterHandler
......
...@@ -20,7 +20,7 @@ from neo.lib.protocol import ZERO_TID ...@@ -20,7 +20,7 @@ from neo.lib.protocol import ZERO_TID
from datetime import timedelta, datetime from datetime import timedelta, datetime
from neo.lib import logging from neo.lib import logging
from neo.lib.protocol import uuid_str from neo.lib.protocol import uuid_str
from neo.lib.util import dump, u64, p64 from neo.lib.util import dump, u64
TID_LOW_OVERFLOW = 2**32 TID_LOW_OVERFLOW = 2**32
TID_LOW_MAX = TID_LOW_OVERFLOW - 1 TID_LOW_MAX = TID_LOW_OVERFLOW - 1
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
from operator import itemgetter from operator import itemgetter
from .neoctl import NeoCTL, NotReadyException from .neoctl import NeoCTL, NotReadyException
from neo.lib.util import bin, p64, u64 from neo.lib.util import p64, u64
from neo.lib.protocol import uuid_str, ClusterStates, NodeTypes, \ from neo.lib.protocol import uuid_str, ClusterStates, NodeTypes, \
UUID_NAMESPACES, ZERO_TID UUID_NAMESPACES, ZERO_TID
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
from optparse import OptionParser from optparse import OptionParser
from neo.lib import logging from neo.lib import logging
from neo.lib.util import parseNodeAddress from neo.lib.util import parseNodeAddress
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import bz2, logging, optparse, os, signal, sqlite3, sys, time import bz2, optparse, os, signal, sqlite3, time
from bisect import insort from bisect import insort
from logging import getLevelName from logging import getLevelName
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from optparse import OptionParser from optparse import OptionParser
import logging
import time import time
import os import os
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from collections import deque from collections import deque
from functools import wraps
from neo.lib import logging from neo.lib import logging
from neo.lib.connection import ClientConnection from neo.lib.connection import ClientConnection
from neo.lib.connector import ConnectorConnectionClosedException from neo.lib.connector import ConnectorConnectionClosedException
......
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import sqlite3 import sqlite3
from array import array
from hashlib import sha1 from hashlib import sha1
import re
import string import string
import traceback import traceback
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
from neo.lib import logging from neo.lib import logging
from neo.lib.util import dump from neo.lib.util import dump
from neo.lib.protocol import CellStates, Packets, ProtocolError from neo.lib.protocol import Packets, ProtocolError
from . import BaseMasterHandler from . import BaseMasterHandler
......
...@@ -16,12 +16,10 @@ ...@@ -16,12 +16,10 @@
import weakref import weakref
from functools import wraps from functools import wraps
import neo.lib
from neo.lib.connector import ConnectorConnectionClosedException from neo.lib.connector import ConnectorConnectionClosedException
from neo.lib.handler import EventHandler from neo.lib.handler import EventHandler
from neo.lib.protocol import Errors, NodeStates, Packets, ProtocolError, \ from neo.lib.protocol import Errors, NodeStates, Packets, ProtocolError, \
ZERO_HASH, ZERO_TID, ZERO_OID ZERO_HASH
from neo.lib.util import add64
def checkConnectionIsReplicatorConnection(func): def checkConnectionIsReplicatorConnection(func):
def wrapper(self, conn, *args, **kw): def wrapper(self, conn, *args, **kw):
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
from . import BaseMasterHandler from . import BaseMasterHandler
from neo.lib import logging from neo.lib import logging
from neo.lib.protocol import Packets, Errors, ProtocolError, INVALID_TID from neo.lib.protocol import Packets, Errors, INVALID_TID
from neo.lib.util import dump from neo.lib.util import dump
from neo.lib.exception import OperationFailure from neo.lib.exception import OperationFailure
......
...@@ -52,8 +52,8 @@ TODO: Packing and replication currently fail when then happen at the same time. ...@@ -52,8 +52,8 @@ TODO: Packing and replication currently fail when then happen at the same time.
import random import random
from neo.lib import bootstrap, logging from neo.lib import logging
from neo.lib.protocol import CellStates, ClusterStates, NodeTypes, NodeStates, \ from neo.lib.protocol import CellStates, NodeTypes, NodeStates, \
Packets, INVALID_TID, ZERO_TID, ZERO_OID Packets, INVALID_TID, ZERO_TID, ZERO_OID
from neo.lib.connection import ClientConnection from neo.lib.connection import ClientConnection
from neo.lib.util import add64, dump from neo.lib.util import add64, dump
......
import sys import sys
import email
import smtplib import smtplib
import optparse import optparse
import platform import platform
......
...@@ -22,8 +22,7 @@ from .. import NeoUnitTestBase, buildUrlFromString, ADDRESS_TYPE ...@@ -22,8 +22,7 @@ from .. import NeoUnitTestBase, buildUrlFromString, ADDRESS_TYPE
from neo.client.app import Application from neo.client.app import Application
from neo.client.cache import test as testCache from neo.client.cache import test as testCache
from neo.client.exception import NEOStorageError, NEOStorageNotFoundError from neo.client.exception import NEOStorageError, NEOStorageNotFoundError
from neo.client.exception import NEOStorageDoesNotExistError from neo.lib.protocol import NodeTypes, Packets, Errors, \
from neo.lib.protocol import NodeTypes, Packet, Packets, Errors, INVALID_TID, \
INVALID_PARTITION, UUID_NAMESPACES INVALID_PARTITION, UUID_NAMESPACES
from neo.lib.util import makeChecksum, SOCKET_CONNECTORS_DICT from neo.lib.util import makeChecksum, SOCKET_CONNECTORS_DICT
import time import time
......
...@@ -19,7 +19,7 @@ from mock import Mock ...@@ -19,7 +19,7 @@ from mock import Mock
from .. import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.node import NodeManager from neo.lib.node import NodeManager
from neo.lib.pt import PartitionTable from neo.lib.pt import PartitionTable
from neo.lib.protocol import NodeTypes, NodeStates from neo.lib.protocol import NodeTypes
from neo.client.handlers.master import PrimaryBootstrapHandler from neo.client.handlers.master import PrimaryBootstrapHandler
from neo.client.handlers.master import PrimaryNotificationsHandler, \ from neo.client.handlers.master import PrimaryNotificationsHandler, \
PrimaryAnswersHandler PrimaryAnswersHandler
......
...@@ -17,12 +17,11 @@ ...@@ -17,12 +17,11 @@
import unittest import unittest
from mock import Mock from mock import Mock
from .. import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import NodeTypes, LockState from neo.lib.protocol import NodeTypes
from neo.client.handlers.storage import StorageBootstrapHandler, \ from neo.client.handlers.storage import StorageBootstrapHandler, \
StorageAnswersHandler StorageAnswersHandler
from neo.client.exception import NEOStorageError, NEOStorageNotFoundError from neo.client.exception import NEOStorageError, NEOStorageNotFoundError
from neo.client.exception import NEOStorageDoesNotExistError from neo.client.exception import NEOStorageDoesNotExistError
from ZODB.POSException import ConflictError
from neo.lib.exception import NodeNotReady from neo.lib.exception import NodeNotReady
from neo.lib.node import NodeManager from neo.lib.node import NodeManager
from ZODB.TimeStamp import TimeStamp from ZODB.TimeStamp import TimeStamp
......
...@@ -20,15 +20,13 @@ import transaction ...@@ -20,15 +20,13 @@ import transaction
import ZODB import ZODB
import socket import socket
from struct import pack, unpack from struct import pack
from neo.neoctl.neoctl import NeoCTL from neo.neoctl.neoctl import NeoCTL
from ZODB.FileStorage import FileStorage from ZODB.FileStorage import FileStorage
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
from ZODB.tests.StorageTestBase import zodb_pickle from ZODB.tests.StorageTestBase import zodb_pickle
from persistent import Persistent from persistent import Persistent
from neo.lib.util import SOCKET_CONNECTORS_DICT
from . import NEOCluster, NEOFunctionalTest from . import NEOCluster, NEOFunctionalTest
from .. import IP_VERSION_FORMAT_DICT
TREE_SIZE = 6 TREE_SIZE = 6
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
import unittest import unittest
import transaction import transaction
from persistent import Persistent
from neo.lib.protocol import NodeStates from neo.lib.protocol import NodeStates
from . import NEOCluster, NEOFunctionalTest from . import NEOCluster, NEOFunctionalTest
......
...@@ -22,7 +22,6 @@ from persistent import Persistent ...@@ -22,7 +22,6 @@ from persistent import Persistent
from . import NEOCluster, NEOFunctionalTest from . import NEOCluster, NEOFunctionalTest
from neo.lib.protocol import ClusterStates, NodeStates from neo.lib.protocol import ClusterStates, NodeStates
from ZODB.tests.StorageTestBase import zodb_pickle from ZODB.tests.StorageTestBase import zodb_pickle
from MySQLdb.constants.ER import NO_SUCH_TABLE
class PObject(Persistent): class PObject(Persistent):
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
import unittest import unittest
from mock import Mock from mock import Mock
from struct import pack, unpack
from .. import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import NodeTypes, NodeStates, Packets from neo.lib.protocol import NodeTypes, NodeStates, Packets
from neo.master.handlers.client import ClientServiceHandler from neo.master.handlers.client import ClientServiceHandler
......
...@@ -18,7 +18,7 @@ import unittest ...@@ -18,7 +18,7 @@ import unittest
from mock import Mock from mock import Mock
from neo.lib import protocol from neo.lib import protocol
from .. import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import Packet, NodeTypes, NodeStates from neo.lib.protocol import NodeTypes, NodeStates
from neo.master.handlers.election import ClientElectionHandler, \ from neo.master.handlers.election import ClientElectionHandler, \
ServerElectionHandler ServerElectionHandler
from neo.master.app import Application from neo.master.app import Application
......
...@@ -15,10 +15,8 @@ ...@@ -15,10 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest import unittest
from mock import Mock
from .. import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.master.app import Application from neo.master.app import Application
from neo.lib.util import p64, u64
class MasterAppTests(NeoUnitTestBase): class MasterAppTests(NeoUnitTestBase):
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest import unittest
from struct import pack, unpack
from .. import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import NodeTypes, NodeStates, CellStates from neo.lib.protocol import NodeTypes, NodeStates, CellStates
from neo.master.recovery import RecoveryManager from neo.master.recovery import RecoveryManager
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
import unittest import unittest
from mock import Mock from mock import Mock
from struct import pack
from .. import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import NodeTypes, NodeStates, Packets from neo.lib.protocol import NodeTypes, NodeStates, Packets
from neo.master.handlers.storage import StorageServiceHandler from neo.master.handlers.storage import StorageServiceHandler
......
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
import unittest import unittest
from mock import Mock from mock import Mock
from struct import pack, unpack from struct import pack
from .. import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import NodeTypes, ZERO_TID from neo.lib.protocol import NodeTypes
from neo.master.transactions import Transaction, TransactionManager from neo.master.transactions import Transaction, TransactionManager
from neo.master.transactions import packTID, unpackTID, addTID, DelayedError from neo.master.transactions import packTID, unpackTID, addTID
class testTransactionManager(NeoUnitTestBase): class testTransactionManager(NeoUnitTestBase):
......
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import math, os, random, sys, time import math, random, sys
from cStringIO import StringIO from cStringIO import StringIO
from persistent.TimeStamp import TimeStamp
from ZODB.utils import p64, u64 from ZODB.utils import p64, u64
from ZODB.BaseStorage import TransactionRecord from ZODB.BaseStorage import TransactionRecord
from ZODB.FileStorage import FileStorage from ZODB.FileStorage import FileStorage
......
...@@ -20,7 +20,7 @@ from collections import deque ...@@ -20,7 +20,7 @@ from collections import deque
from neo.lib.util import makeChecksum from neo.lib.util import makeChecksum
from .. import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.storage.app import Application from neo.storage.app import Application
from neo.storage.transactions import ConflictError, DelayedError from neo.storage.transactions import ConflictError
from neo.storage.handlers.client import ClientOperationHandler from neo.storage.handlers.client import ClientOperationHandler
from neo.lib.protocol import INVALID_PARTITION, INVALID_TID, INVALID_OID from neo.lib.protocol import INVALID_PARTITION, INVALID_TID, INVALID_OID
from neo.lib.protocol import Packets, LockState, ZERO_HASH from neo.lib.protocol import Packets, LockState, ZERO_HASH
......
...@@ -15,12 +15,11 @@ ...@@ -15,12 +15,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest import unittest
from mock import Mock
from .. import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.pt import PartitionTable from neo.lib.pt import PartitionTable
from neo.storage.app import Application from neo.storage.app import Application
from neo.storage.handlers.initialization import InitializationHandler from neo.storage.handlers.initialization import InitializationHandler
from neo.lib.protocol import CellStates, ProtocolError from neo.lib.protocol import CellStates
from neo.lib.exception import PrimaryFailure from neo.lib.exception import PrimaryFailure
class StorageInitializationHandlerTests(NeoUnitTestBase): class StorageInitializationHandlerTests(NeoUnitTestBase):
......
...@@ -23,7 +23,6 @@ from neo.storage.handlers.master import MasterOperationHandler ...@@ -23,7 +23,6 @@ from neo.storage.handlers.master import MasterOperationHandler
from neo.lib.exception import PrimaryFailure, OperationFailure from neo.lib.exception import PrimaryFailure, OperationFailure
from neo.lib.pt import PartitionTable from neo.lib.pt import PartitionTable
from neo.lib.protocol import CellStates, ProtocolError, Packets from neo.lib.protocol import CellStates, ProtocolError, Packets
from neo.lib.protocol import INVALID_TID, INVALID_OID
class StorageMasterHandlerTests(NeoUnitTestBase): class StorageMasterHandlerTests(NeoUnitTestBase):
......
...@@ -21,7 +21,6 @@ from neo.storage.app import Application ...@@ -21,7 +21,6 @@ from neo.storage.app import Application
from neo.lib.protocol import CellStates from neo.lib.protocol import CellStates
from collections import deque from collections import deque
from neo.lib.pt import PartitionTable from neo.lib.pt import PartitionTable
from neo.lib.util import dump
from neo.storage.exception import AlreadyPendingError from neo.storage.exception import AlreadyPendingError
class StorageAppTests(NeoUnitTestBase): class StorageAppTests(NeoUnitTestBase):
......
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
from binascii import a2b_hex from binascii import a2b_hex
import unittest import unittest
from mock import Mock from neo.lib.util import add64, p64, u64
from neo.lib.util import add64, dump, p64, u64
from neo.lib.protocol import CellStates, ZERO_HASH, ZERO_OID, ZERO_TID, MAX_TID from neo.lib.protocol import CellStates, ZERO_HASH, ZERO_OID, ZERO_TID, MAX_TID
from .. import NeoUnitTestBase from .. import NeoUnitTestBase
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest import unittest
from mock import Mock
from . import NeoUnitTestBase from . import NeoUnitTestBase
from neo.storage.app import Application from neo.storage.app import Application
from neo.lib.bootstrap import BootstrapManager from neo.lib.bootstrap import BootstrapManager
......
...@@ -25,9 +25,8 @@ from . import DoNothingConnector ...@@ -25,9 +25,8 @@ from . import DoNothingConnector
from neo.lib.connector import ConnectorException, ConnectorTryAgainException, \ from neo.lib.connector import ConnectorException, ConnectorTryAgainException, \
ConnectorInProgressException, ConnectorConnectionRefusedException ConnectorInProgressException, ConnectorConnectionRefusedException
from neo.lib.handler import EventHandler from neo.lib.handler import EventHandler
from neo.lib.protocol import Packets, ParserState, PACKET_HEADER_FORMAT from neo.lib.protocol import Packets, PACKET_HEADER_FORMAT
from . import NeoUnitTestBase from . import NeoUnitTestBase
from neo.lib.util import ReadBuffer
from neo.lib.locking import Queue from neo.lib.locking import Queue
class ConnectionTests(NeoUnitTestBase): class ConnectionTests(NeoUnitTestBase):
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
import sys import sys
import threading import threading
import traceback
import transaction import transaction
import unittest import unittest
from thread import get_ident from thread import get_ident
......
...@@ -15,25 +15,17 @@ ...@@ -15,25 +15,17 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import random import random
import sys
import time import time
import threading
import transaction
import unittest import unittest
from collections import defaultdict from collections import defaultdict
from functools import wraps from functools import wraps
from neo.lib import logging from neo.lib import logging
from neo.storage.checker import CHECK_COUNT from neo.storage.checker import CHECK_COUNT
from neo.storage.replicator import Replicator from neo.lib.protocol import CellStates, ClusterStates, Packets, \
from neo.storage.transactions import TransactionManager, \
DelayedError, ConflictError
from neo.lib.connection import MTClientConnection
from neo.lib.protocol import CellStates, ClusterStates, NodeStates, Packets, \
ZERO_OID, ZERO_TID, MAX_TID, uuid_str ZERO_OID, ZERO_TID, MAX_TID, uuid_str
from neo.lib.util import p64 from neo.lib.util import p64
from . import ConnectionFilter, NEOCluster, NEOThreadedTest, Patch, \ from . import ConnectionFilter, NEOCluster, NEOThreadedTest, Patch, \
predictable_random predictable_random
from neo.client.pool import CELL_CONNECTED, CELL_GOOD
def backup_test(partitions=1, upstream_kw={}, backup_kw={}): def backup_test(partitions=1, upstream_kw={}, backup_kw={}):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment