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

Drop some unused imports.

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