Commit f78f7339 authored by Julien Muchembled's avatar Julien Muchembled

Remove all trailing whitespaces

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2749 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent df900556
......@@ -32,7 +32,7 @@ Overview
primary master, and monitors cluster state.
- "client" nodes
Well... Something needing to store/load data in a NEO cluster.
Well... Something needing to store/load data in a NEO cluster.
Disclaimer
......
......@@ -35,19 +35,19 @@ requirements :
- python2.4 or higher
- ctypes (http://python.net/crew/theller/ctypes/) (If you're using python2.5 or
higher, ctypes is directly included with python)
- mock (http://python-mock.sourceforge.net/) (Only if you plan to make the
- mock (http://python-mock.sourceforge.net/) (Only if you plan to make the
neo tests)
############################
### 1.Quick installation ###
############################
You're a neo-newbie ? You don't need neo sources ? You want a full version and
not just one or two modules ? Or, more commonly, you're in a hurry ? So type
You're a neo-newbie ? You don't need neo sources ? You want a full version and
not just one or two modules ? Or, more commonly, you're in a hurry ? So type
the following commands :
$ svn checkout https//svn.erp5.org/repos/neo/trunk/buildout/software-profiles/neo.cfg
When your bootstrap's done, check that you've got bin/buildout script. Then
When your bootstrap's done, check that you've got bin/buildout script. Then
Edit your buildout.cfg file, and delete all the neo-eggs which corresponds
to the parts you don't need. Then run :
......@@ -80,25 +80,25 @@ Run neo tests :
$ bin/neotestrunner -fzu (functional, unit tests and zodb tests)
If this returns no errors or fails, it means that it's over for you ! Neo's
If this returns no errors or fails, it means that it's over for you ! Neo's
correctly installed on your machine, congratulations !
#############################
### 3. Building neo eggs ###
#############################
This part is recommended for experienced users, who wants to make a neo
This part is recommended for experienced users, who wants to make a neo
installation from beginning. It explains how to make eggs from a
precise neo part, instead of eggifying the whole project.
Each part of neo (lib, admin, master, storage, neoctl, client) has its own
setup.py file, which is located on <download_neo>/trunk/setup_files, ans which
allows to build the linked egg. See VI. Setup files to check which setup.py
Each part of neo (lib, admin, master, storage, neoctl, client) has its own
setup.py file, which is located on <download_neo>/trunk/setup_files, ans which
allows to build the linked egg. See VI. Setup files to check which setup.py
file you need. Then execute the following commands :
$ svn checkout https://svn.erp5.org/repos/neo/trunk
$ svn checkout https://svn.erp5.org/repos/neo/trunk
$ cd <download_neo>/trunk/neo
(setup_cmn.py is the main part of neo, needed by all other processes)
(setup_cmn.py is the main part of neo, needed by all other processes)
$ python setup.*.py bdist_egg
Check in your trunk/bdist folder that you have an egg for each part of neo you
......@@ -111,13 +111,13 @@ want to install. If it's ok, then go on to part II.
Problem : The egg I need is not present in my trunk/bdist folder.
Solution : Select the correct setup_<part>.py in trunk/setup_files
Problem: bin/buildout is not present
Problem: bin/buildout is not present
Solution: Launch the bootstrap command
Problem : bootstrap command is not working
Solution : Try to use another python version
Tests errors :
Tests errors :
'neoadmin' not found
'neomaster' not found
'neostorage' not found
......
......@@ -2,7 +2,7 @@
[buildout]
# extends-cache = extends-cache
parts =
parts =
neoinstall
find-links =
../../eggs/
......
......@@ -3,7 +3,7 @@ PYTHON=python2.6
INSTALL_DIR=eggs/
cd dirname $0/..
case "$1" in
case "$1" in
"develop")
MODE=develop
PYTHONPATH=$PYTHONPATH:$INSTALL_DIR;;
......@@ -17,4 +17,4 @@ $PYTHON setup_ctl.py $MODE --dist-dir=$INSTALL_DIR
$PYTHON setup_tests.py $MODE --dist-dir=$INSTALL_DIR
$PYTHON setup_storage.py $MODE --dist-dir=$INSTALL_DIR
$PYTHON setup_master.py $MODE --dist-dir=$INSTALL_DIR
......@@ -32,7 +32,7 @@ partitions: 20
# They are:
# bind: The ip:port the node will listen on.
# database: Storage nodes only. The MySQL database credentials to use
# (username:password@database).
# (username:password@database).
# Those database must be created manualy.
# Admin node
......
......@@ -52,7 +52,7 @@ class SocketConnector:
self.is_listening = False
self.is_closed = False
if s is None:
self.socket = socket.socket(self.af_type, socket.SOCK_STREAM)
self.socket = socket.socket(self.af_type, socket.SOCK_STREAM)
else:
self.socket = s
self.socket_fd = self.socket.fileno()
......@@ -102,7 +102,7 @@ class SocketConnector:
try:
(new_s, addr) = self._accept()
new_s = self.__class__(new_s, accepted_from=addr)
return (new_s, addr)
return (new_s, addr)
except socket.error, (err, errmsg):
if err == errno.EAGAIN:
raise ConnectorTryAgainException
......@@ -168,7 +168,7 @@ class SocketConnector:
def _accept(self):
raise NotImplementedError
class SocketConnectorIPv4(SocketConnector):
" Wrapper for IPv4 sockets"
af_type = socket.AF_INET
......@@ -178,21 +178,21 @@ class SocketConnectorIPv4(SocketConnector):
def getAddress(self):
return self.socket.getsockname()
class SocketConnectorIPv6(SocketConnector):
" Wrapper for IPv6 sockets"
af_type = socket.AF_INET6
" Wrapper for IPv6 sockets"
af_type = socket.AF_INET6
def _accept(self):
new_s, addr = self.socket.accept()
new_s, addr = self.socket.accept()
addr = (addr[0], addr[1])
return (new_s, addr)
def getAddress(self):
addr = self.socket.getsockname()
addr = (addr[0], addr[1])
return addr
registerConnectorHandler(SocketConnectorIPv4)
registerConnectorHandler(SocketConnectorIPv6)
......
......@@ -22,7 +22,7 @@ from zlib import adler32
from Queue import deque
from struct import pack, unpack
SOCKET_CONNECTORS_DICT = {
SOCKET_CONNECTORS_DICT = {
socket.AF_INET : 'SocketConnectorIPv4',
socket.AF_INET6: 'SocketConnectorIPv6',
}
......@@ -77,10 +77,10 @@ def resolve(hostname):
return None
return address_list[0]
def getAddressType(address):
def getAddressType(address):
"Return the type (IPv4 or IPv6) of an ip"
(host, port) = address
for af_type in SOCKET_CONNECTORS_DICT.keys():
try :
socket.inet_pton(af_type, host)
......@@ -88,14 +88,14 @@ def getAddressType(address):
continue
else:
break
else:
raise ValueError("Unknown type of host", host)
else:
raise ValueError("Unknown type of host", host)
return af_type
def getConnectorFromAddress(address):
address_type = getAddressType(address)
address_type = getAddressType(address)
return SOCKET_CONNECTORS_DICT[address_type]
def parseNodeAddress(address, port_opt=None):
if ']' in address:
(ip, port) = address.split(']')
......@@ -109,11 +109,11 @@ def parseNodeAddress(address, port_opt=None):
else:
ip = address
port = port_opt
if port is None:
raise ValueError
return (ip, int(port))
def parseMasterList(masters, except_node=None):
assert masters, 'At least one master must be defined'
socket_connector = ''
......@@ -131,11 +131,11 @@ def parseMasterList(masters, except_node=None):
if socket_connector == '':
socket_connector = socket_connector_temp
elif socket_connector == socket_connector_temp:
pass
pass
else:
return TypeError, (" Wrong connector type : you're trying to use ipv6 and ipv4 simultaneously")
return tuple(master_node_list), socket_connector
return tuple(master_node_list), socket_connector
class Enum(dict):
"""
......
......@@ -58,7 +58,7 @@ class Application(object):
self.connector_handler = getConnectorHandler(connector_name)
for master_address in master_addresses :
self.nm.createMaster(address=master_address)
neo.lib.logging.debug('IP address is %s, port is %d', *(self.server))
# Partition table
......
......@@ -272,7 +272,7 @@ class TransactionManager(object):
def _nextTID(self, ttid, divisor):
"""
Compute the next TID based on the current time and check collisions.
Also, adjust it so that
Also, adjust it so that
tid % divisor == ttid % divisor
while preserving
min_tid < tid
......
......@@ -40,7 +40,7 @@ class NeoCTL(object):
def __getConnection(self):
if not self.connected:
self.connection = ClientConnection(self.em, self.handler,
self.connection = ClientConnection(self.em, self.handler,
addr=self.server, connector=self.connector_handler())
while self.connection is not None:
if self.connected:
......@@ -140,7 +140,7 @@ class NeoCTL(object):
"""
Set node into "down" state and remove it from partition table.
"""
return self.setNodeState(node, NodeStates.DOWN,
return self.setNodeState(node, NodeStates.DOWN,
update_partition_table=1)
def getPrimary(self):
......
# neoadmin - run an administrator node of NEO
#
# Copyright (C) 2009 Nexedi SA
#
#
# 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
......@@ -23,10 +23,10 @@ from neo.lib.config import ConfigurationManager
parser = OptionParser()
parser.add_option('-u', '--uuid', help='specify an UUID to use for this ' \
'process')
parser.add_option('-v', '--verbose', action = 'store_true',
parser.add_option('-v', '--verbose', action = 'store_true',
help = 'print verbose messages')
parser.add_option('-f', '--file', help = 'specify a configuration file')
parser.add_option('-s', '--section', help = 'specify a configuration section')
parser.add_option('-f', '--file', help = 'specify a configuration file')
parser.add_option('-s', '--section', help = 'specify a configuration section')
parser.add_option('-l', '--logfile', help = 'specify a logging file')
parser.add_option('-c', '--cluster', help = 'the cluster name')
parser.add_option('-m', '--masters', help = 'master node list')
......
# neoadmin - run an administrator node of NEO
#
# Copyright (C) 2009 Nexedi SA
#
#
# 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
......@@ -22,7 +22,7 @@ from neo.lib import setupLog
from neo.lib.util import parseNodeAddress
parser = OptionParser()
parser.add_option('-v', '--verbose', action = 'store_true',
parser.add_option('-v', '--verbose', action = 'store_true',
help = 'print verbose messages')
parser.add_option('-a', '--address', help = 'specify the address (ip:port) ' \
'of an admin node', default = '127.0.0.1:9999')
......@@ -31,10 +31,10 @@ parser.add_option('--handler', help = 'specify the connection handler')
def main(args=None):
(options, args) = parser.parse_args(args=args)
if options.address is not None:
address = parseNodeAddress(options.address, 9999)
address = parseNodeAddress(options.address, 9999)
else:
address = ('127.0.0.1', 9999)
setupLog('NEOCTL', options.verbose)
from neo.neoctl.app import Application
......
# neomaster - run a master node of NEO
#
# Copyright (C) 2006 Nexedi SA
#
#
# 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
......@@ -21,10 +21,10 @@ from neo.lib import setupLog
from neo.lib.config import ConfigurationManager
parser = OptionParser()
parser.add_option('-v', '--verbose', action = 'store_true',
parser.add_option('-v', '--verbose', action = 'store_true',
help = 'print verbose messages')
parser.add_option('-f', '--file', help = 'specify a configuration file')
parser.add_option('-s', '--section', help = 'specify a configuration section')
parser.add_option('-f', '--file', help = 'specify a configuration file')
parser.add_option('-s', '--section', help = 'specify a configuration section')
parser.add_option('-u', '--uuid', help='the node UUID (testing purpose)')
parser.add_option('-n', '--name', help = 'the node name (impove logging)')
parser.add_option('-b', '--bind', help = 'the local address to bind to')
......
......@@ -3,12 +3,12 @@
# neomaster - run a master node of NEO
#
# Copyright (C) 2006 Nexedi SA
#
#
# 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
......@@ -27,7 +27,7 @@ from neo.lib import setupLog
# register options
parser = OptionParser()
parser.add_option('-v', '--verbose', action = 'store_true',
parser.add_option('-v', '--verbose', action = 'store_true',
help = 'print verbose messages')
parser.add_option('-s', '--source', help = 'the source database')
parser.add_option('-d', '--destination', help = 'the destination database')
......
......@@ -3,12 +3,12 @@
# neostorage - run a storage node of NEO
#
# Copyright (C) 2006 Nexedi SA
#
#
# 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
......@@ -24,13 +24,13 @@ from neo.lib.config import ConfigurationManager
parser = OptionParser()
parser.add_option('-v', '--verbose', action = 'store_true',
parser.add_option('-v', '--verbose', action = 'store_true',
help = 'print verbose messages')
parser.add_option('-u', '--uuid', help='specify an UUID to use for this ' \
'process. Previously assigned UUID takes precedence (ie ' \
'you should always use -R with this switch)')
parser.add_option('-f', '--file', help = 'specify a configuration file')
parser.add_option('-s', '--section', help = 'specify a configuration section')
parser.add_option('-f', '--file', help = 'specify a configuration file')
parser.add_option('-s', '--section', help = 'specify a configuration section')
parser.add_option('-l', '--logfile', help = 'specify a logging file')
parser.add_option('-R', '--reset', action = 'store_true',
help = 'remove an existing database if any')
......@@ -61,9 +61,9 @@ def main(args=None):
adapter = options.adapter,
)
config = ConfigurationManager(
defaults,
options.file,
options.section or 'storage',
defaults,
options.file,
options.section or 'storage',
arguments,
)
......
#! /usr/bin/env python
#
# Copyright (C) 2009 Nexedi SA
#
#
# 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
......@@ -29,7 +29,7 @@ from neo.tests.benchmark import BenchmarkRunner
# list of test modules
# each of them have to import its TestCase classes
UNIT_TEST_MODULES = [
UNIT_TEST_MODULES = [
# generic parts
'neo.tests.testBootstrap',
'neo.tests.testConnection',
......@@ -138,7 +138,7 @@ class NeoTestRunner(unittest.TestResult):
module = test.__class__.__module__
module = tuple(module.split('.'))
try:
return self.modulesStats[module]
return self.modulesStats[module]
except KeyError:
self.modulesStats[module] = self.ModuleStats()
return self.modulesStats[module]
......@@ -186,7 +186,7 @@ class NeoTestRunner(unittest.TestResult):
header = "%25s | run | success | errors | fails | time \n" % 'Test Module'
separator = "%25s-+---------+---------+---------+---------+----------\n" % ('-' * 25)
format = "%25s | %3s | %3s | %3s | %3s | %6.2fs \n"
group_f = "%25s | | | | | \n"
group_f = "%25s | | | | | \n"
# header
s = ' ' * 30 + ' NEO TESTS REPORT'
s += '\n'
......
......@@ -55,7 +55,7 @@ class Application(object):
self.connector_handler = getConnectorHandler(connector_name)
for master_address in master_addresses :
self.nm.createMaster(address=master_address)
# set the bind address
self.server = config.getBind()
neo.lib.logging.debug('IP address is %s, port is %d', *(self.server))
......
......@@ -805,7 +805,7 @@ class MySQLDatabaseManager(DatabaseManager):
self.rollback()
raise
self.commit()
def checkTIDRange(self, min_tid, max_tid, length, num_partitions, partition):
# XXX: XOR is a lame checksum
count, tid_checksum, max_tid = self.query('SELECT COUNT(*), '
......
......@@ -193,7 +193,7 @@ class TransactionManager(object):
self._load_lock_dict.get(oid) != ttid:
raise ValueError, 'Some locks are not held'
object_list = transaction.getObjectList()
# txn_info is None is the transaction information is not stored on
# txn_info is None is the transaction information is not stored on
# this storage.
txn_info = transaction.getTransactionInformations()
# store data from memory to temporary table
......@@ -263,7 +263,7 @@ class TransactionManager(object):
if history_list:
previous_serial = history_list[0][0]
if previous_serial is not None and previous_serial != serial:
neo.lib.logging.info('Resolvable conflict on %r:%r',
neo.lib.logging.info('Resolvable conflict on %r:%r',
dump(oid), dump(ttid))
raise ConflictError(previous_serial)
neo.lib.logging.debug('Transaction %s storing %s',
......
......@@ -96,7 +96,7 @@ class BenchmarkRunner(object):
if self._config.mail_to:
self.send_report(subject, report)
print subject
print
print
print report
def was_successful(self):
......
......@@ -307,7 +307,7 @@ class ClientApplicationTests(NeoUnitTestBase):
app.pt = Mock({ 'getCellListForOID': (cell, cell)})
app.cp = self.getConnectionPool([(node, conn)])
class Dispatcher(object):
def pending(self, queue):
def pending(self, queue):
return not queue.empty()
app.dispatcher = Dispatcher()
app.nm.createStorage(address=storage_address)
......@@ -338,7 +338,7 @@ class ClientApplicationTests(NeoUnitTestBase):
app.cp = self.getConnectionPool([(node, conn)])
app.pt = Mock({ 'getCellListForOID': (cell, cell, ) })
class Dispatcher(object):
def pending(self, queue):
def pending(self, queue):
return not queue.empty()
app.dispatcher = Dispatcher()
app.nm.createStorage(address=storage_address)
......@@ -567,7 +567,7 @@ class ClientApplicationTests(NeoUnitTestBase):
'getConnForCell': conn,
})
class Dispatcher(object):
def pending(self, queue):
def pending(self, queue):
return not queue.empty()
app.dispatcher = Dispatcher()
def load(oid, tid, before_tid):
......
......@@ -55,7 +55,7 @@ class MasterBootstrapHandlerTests(MasterHandlerTests):
""" Non-master node """
conn = self.getConnection()
uuid = self.getNewUUID()
self.handler.acceptIdentification(conn, NodeTypes.CLIENT,
self.handler.acceptIdentification(conn, NodeTypes.CLIENT,
uuid, 100, 0, None)
self.checkClosed(conn)
......@@ -75,7 +75,7 @@ class MasterBootstrapHandlerTests(MasterHandlerTests):
partitions = 100
replicas = 2
self.app.nm = Mock({'getByAddress': node})
self.handler.acceptIdentification(conn, NodeTypes.MASTER, uuid,
self.handler.acceptIdentification(conn, NodeTypes.MASTER, uuid,
partitions, replicas, your_uuid)
self.assertEqual(self.app.uuid, your_uuid)
self.checkUUIDSet(conn, uuid)
......@@ -189,13 +189,13 @@ class MasterNotificationsHandlerTests(MasterHandlerTests):
conn1 = self.getFakeConnection()
conn2 = self.getFakeConnection()
node1 = Mock({
'getConnection': conn1,
'getConnection': conn1,
'__nonzero__': 1,
'isConnected': True,
'__repr__': 'Fake Node',
})
node2 = Mock({
'getConnection': conn2,
'getConnection': conn2,
'__nonzero__': 1,
'isConnected': True,
'__repr__': 'Fake Node',
......@@ -258,7 +258,7 @@ class MasterAnswersHandlerTests(MasterHandlerTests):
calls = self.app.mockGetNamedCalls('setHandlerData')
self.assertEqual(len(calls), 1)
calls[0].checkArgs(tid2)
def test_answerPack(self):
self.assertRaises(NEOStorageError, self.handler.answerPack, None, False)
# Check it doesn't raise
......
......@@ -226,7 +226,7 @@ class StorageAnswerHandlerTests(NeoUnitTestBase):
conn = self.getConnection()
self.assertRaises(NEOStorageDoesNotExistError,
self.handler.oidDoesNotExist, conn, 'message')
def test_tidNotFound(self):
conn = self.getConnection()
self.assertRaises(NEOStorageNotFoundError, self.handler.tidNotFound,
......
......@@ -269,13 +269,13 @@ class ClientTests(NEOFunctionalTest):
def testIPv6Client(self):
""" Test the connectivity of an IPv6 connection for neo client """
def test():
"""
"""
Implement the IPv6Client test
"""
self.neo = NEOCluster(['test_neo1'], replicas=0,
temp_dir = self.getTempDirectory(),
temp_dir = self.getTempDirectory(),
address_type = socket.AF_INET6
)
neoctl = NeoCTL(('::1', 0))
......@@ -283,7 +283,7 @@ class ClientTests(NEOFunctionalTest):
db1, conn1 = self.neo.getZODBConnection()
db2, conn2 = self.neo.getZODBConnection()
self.runWithTimeout(40, test)
def testDelayedLocksCancelled(self):
"""
Hold a lock on an object, try to get another lock on the same
......
......@@ -123,7 +123,7 @@ class MasterClientElectionTests(NeoUnitTestBase):
""" A non-master node accept identification """
node, conn = self.identifyToMasterNode()
args = (node.getUUID(), 0, 10, self.app.uuid)
self.election.acceptIdentification(conn,
self.election.acceptIdentification(conn,
NodeTypes.CLIENT, *args)
self.assertFalse(node in self.app.unconnected_master_node_set)
self.assertFalse(node in self.app.negotiating_master_node_set)
......@@ -228,15 +228,15 @@ class MasterServerElectionTests(NeoUnitTestBase):
""" A non-master node request identification """
node, conn = self.identifyToMasterNode()
args = (node.getUUID(), node.getAddress(), self.app.name)
self.assertRaises(protocol.NotReadyError,
self.election.requestIdentification,
self.assertRaises(protocol.NotReadyError,
self.election.requestIdentification,
conn, NodeTypes.CLIENT, *args)
def test_requestIdentification2(self):
""" A unknown master node request identification """
node, conn = self.identifyToMasterNode()
args = (node.getUUID(), ('127.0.0.1', 1000), self.app.name)
self.checkProtocolErrorRaised(self.election.requestIdentification,
self.checkProtocolErrorRaised(self.election.requestIdentification,
conn, NodeTypes.MASTER, *args)
def test_requestIdentification3(self):
......@@ -244,8 +244,8 @@ class MasterServerElectionTests(NeoUnitTestBase):
node, conn = self.identifyToMasterNode()
node.setBroken()
args = (node.getUUID(), node.getAddress(), self.app.name)
self.assertRaises(protocol.BrokenNodeDisallowedError,
self.election.requestIdentification,
self.assertRaises(protocol.BrokenNodeDisallowedError,
self.election.requestIdentification,
conn, NodeTypes.MASTER, *args)
def test_requestIdentification4(self):
......
......@@ -152,7 +152,7 @@ class StorageClientHandlerTests(NeoUnitTestBase):
cell = Mock({'getUUID':self.app.uuid})
self.app.dm = Mock({'getTIDList': (INVALID_TID, )})
self.app.pt = Mock({
'getCellList': (cell, ),
'getCellList': (cell, ),
'getPartitions': 1,
'getAssignedPartitionList': [0],
})
......@@ -215,7 +215,7 @@ class StorageClientHandlerTests(NeoUnitTestBase):
conn = self._getConnection(uuid=uuid)
tid = self.getNextTID()
oid, serial, comp, checksum, data = self._getObject()
self.operation.askStoreObject(conn, oid, serial, comp, checksum,
self.operation.askStoreObject(conn, oid, serial, comp, checksum,
data, None, tid, False)
self._checkStoreObjectCalled(tid, serial, oid, comp,
checksum, data, None, False)
......@@ -232,7 +232,7 @@ class StorageClientHandlerTests(NeoUnitTestBase):
tid = self.getNextTID()
oid, serial, comp, checksum, data = self._getObject()
data_tid = self.getNextTID()
self.operation.askStoreObject(conn, oid, serial, comp, checksum,
self.operation.askStoreObject(conn, oid, serial, comp, checksum,
'', data_tid, tid, False)
self._checkStoreObjectCalled(tid, serial, oid, comp,
checksum, None, data_tid, False)
......@@ -252,7 +252,7 @@ class StorageClientHandlerTests(NeoUnitTestBase):
raise ConflictError(locking_tid)
self.app.tm.storeObject = fakeStoreObject
oid, serial, comp, checksum, data = self._getObject()
self.operation.askStoreObject(conn, oid, serial, comp, checksum,
self.operation.askStoreObject(conn, oid, serial, comp, checksum,
data, None, tid, False)
pconflicting, poid, pserial = self.checkAnswerStoreObject(conn,
decode=True)
......
......@@ -454,7 +454,7 @@ class StorageDBTests(NeoUnitTestBase):
txn4, objs4 = self.getTransaction([oid2])
txn5, objs5 = self.getTransaction([oid3])
self.db.storeTransaction(tid1, objs1, txn1)
self.db.storeTransaction(tid2, objs2, txn2)
self.db.storeTransaction(tid2, objs2, txn2)
self.db.storeTransaction(tid3, objs3, txn3)
self.db.storeTransaction(tid4, objs4, txn4)
self.db.storeTransaction(tid5, objs5, txn5)
......@@ -524,7 +524,7 @@ class StorageDBTests(NeoUnitTestBase):
result = self.db.getTIDList(0, 1, 2, [0])
self.checkSet(result, [tid3]) # desc order
result = self.db.getTIDList(1, 1, 2, [1])
self.checkSet(result, [tid2])
self.checkSet(result, [tid2])
result = self.db.getTIDList(2, 2, 2, [0])
self.checkSet(result, [])
......
......@@ -90,8 +90,8 @@ class ProtocolTests(NeoUnitTestBase):
self.assertEqual(p_uuid, uuid)
self.assertEqual(ip, self.local_ip)
self.assertEqual(port, 9080)
self.assertEqual(name, "unittest")
self.assertEqual(name, "unittest")
def test_12_AcceptIdentification(self):
uuid1, uuid2 = self.getNewUUID(), self.getNewUUID()
p = Packets.AcceptIdentification(NodeTypes.CLIENT, uuid1,
......@@ -134,7 +134,7 @@ class ProtocolTests(NeoUnitTestBase):
primary_uuid, p_master_list = p.decode()
self.assertEqual(primary_uuid, uuid)
self.assertEqual(master_list, p_master_list)
def test_15_announcePrimary(self):
p = Packets.AnnouncePrimary()
self.assertEqual(p.decode(), ())
......@@ -594,7 +594,7 @@ class ProtocolTests(NeoUnitTestBase):
self.getNewUUID(), NodeStates.RUNNING)
p = Packets.AnswerNodeList((node1, node2))
self.assertEqual(p.decode(), ([node1, node2], ))
def test_AskPartitionList(self):
min_offset = 10
max_offset = 20
......
......@@ -20,7 +20,7 @@ import unittest
import socket
from neo.tests import NeoUnitTestBase, IP_VERSION_FORMAT_DICT
from neo.lib.util import ReadBuffer, getAddressType, parseNodeAddress, \
getConnectorFromAddress, SOCKET_CONNECTORS_DICT
getConnectorFromAddress, SOCKET_CONNECTORS_DICT
class UtilTests(NeoUnitTestBase):
......@@ -34,7 +34,7 @@ class UtilTests(NeoUnitTestBase):
self.assertEqual(connector, SOCKET_CONNECTORS_DICT[socket.AF_INET6])
self.assertRaises(ValueError, getConnectorFromAddress, ('', 0))
self.assertRaises(ValueError, getConnectorFromAddress, ('test', 0))
def test_getAddressType(self):
""" Get the type on an IP Address """
self.assertRaises(ValueError, getAddressType, ('', 0))
......@@ -61,7 +61,7 @@ class UtilTests(NeoUnitTestBase):
ip_address = parseNodeAddress('[::1]', 500)
self.assertEqual(('::1', 500), ip_address)
self.assertRaises(ValueError, parseNodeAddress, ('[::1]'))
def testReadBufferRead(self):
""" Append some chunk then consume the data """
buf = ReadBuffer()
......
......@@ -22,7 +22,7 @@ from ZODB.tests.ConflictResolution import ConflictResolvingTransUndoStorage
from neo.tests.zodb import ZODBTestCase
class UndoTests(ZODBTestCase, StorageTestBase, TransactionalUndoStorage,
class UndoTests(ZODBTestCase, StorageTestBase, TransactionalUndoStorage,
ConflictResolvingTransUndoStorage):
pass
......
......@@ -3,12 +3,12 @@
# neoadmin - run an administrator node of NEO
#
# Copyright (C) 2009 Nexedi SA
#
#
# 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
......
......@@ -3,12 +3,12 @@
# neoadmin - run an administrator node of NEO
#
# Copyright (C) 2009 Nexedi SA
#
#
# 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
......
......@@ -3,12 +3,12 @@
# neomaster - run a master node of NEO
#
# Copyright (C) 2006 Nexedi SA
#
#
# 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
......
......@@ -3,12 +3,12 @@
# neomigrate - import/export data between NEO and a FileStorage
#
# Copyright (C) 2006 Nexedi SA
#
#
# 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
......
......@@ -3,12 +3,12 @@
# neostorage - run a storage node of NEO
#
# Copyright (C) 2006 Nexedi SA
#
#
# 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
......
......@@ -20,13 +20,13 @@ setup(name='neoadmin',
],
packages=['neo.admin'],
package_dir={
'neo':'neo',
},
namespace_packages=['neo','neo.scripts'],
namespace_packages=['neo','neo.scripts'],
install_requires=[
'neo',
],
......@@ -35,7 +35,7 @@ setup(name='neoadmin',
'console_scripts': [
'neoadmin=neo.scripts.neoadmin:main',
],
},
},
zip_safe=False,
)
......@@ -19,14 +19,14 @@ setup(name='neoclient',
'neo.scripts.neomigrate',
],
packages=['neo.client','neo.client.handlers'],
packages=['neo.client','neo.client.handlers'],
package_dir={
'neo':'neo',
},
namespace_packages=['neo','neo.client'],
namespace_packages=['neo','neo.client'],
install_requires=[
'neo',
'ZODB3',
......
......@@ -25,8 +25,8 @@ setup(name='neoctl',
'neo':'neo',
},
namespace_packages=['neo','neo.scripts'],
namespace_packages=['neo','neo.scripts'],
install_requires=[
'neo',
],
......@@ -35,7 +35,7 @@ setup(name='neoctl',
'console_scripts': [
'neoctl=neo.scripts.neoctl:main',
],
},
},
zip_safe=False,
)
......@@ -25,8 +25,8 @@ setup(name='neomaster',
'neo':'neo',
},
namespace_packages=['neo','neo.scripts'],
namespace_packages=['neo','neo.scripts'],
install_requires=[
'neo',
],
......@@ -35,7 +35,7 @@ setup(name='neomaster',
'console_scripts': [
'neomaster=neo.scripts.neomaster:main',
],
},
},
zip_safe=False,
)
......@@ -21,13 +21,13 @@ setup(name='neostorage',
],
packages=['neo.storage','neo.storage.database','neo.storage.handlers'],
package_dir={
'neo':'neo',
},
namespace_packages=['neo','neo.scripts'],
namespace_packages=['neo','neo.scripts'],
install_requires=[
'neo',
'MySQL-python',
......@@ -37,7 +37,7 @@ setup(name='neostorage',
'console_scripts': [
'neostorage=neo.scripts.neostorage:main',
],
},
},
zip_safe=False,
)
......@@ -25,8 +25,8 @@ setup(name='neotests',
'neo':'neo',
},
namespace_packages=['neo','neo.scripts'],
namespace_packages=['neo','neo.scripts'],
install_requires=[
'neo',
'neoadmin',
......@@ -35,13 +35,13 @@ setup(name='neotests',
'neomaster',
'neoctl',
'mock'
],
],
entry_points = {
'console_scripts': [
'neotestrunner=neo.scripts.runner:main',
],
},
},
zip_safe=False,
)
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