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