Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
neoppod
Commits
ea5cdd0b
Commit
ea5cdd0b
authored
Jul 22, 2014
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: revert addition of 'app' parameter in setup()
This is not a valid place to call app.newTask
parent
c2cc0c11
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
9 additions
and
9 deletions
+9
-9
neo/storage/app.py
neo/storage/app.py
+1
-1
neo/storage/database/manager.py
neo/storage/database/manager.py
+3
-3
neo/storage/database/mysqldb.py
neo/storage/database/mysqldb.py
+1
-1
neo/storage/database/sqlite.py
neo/storage/database/sqlite.py
+1
-1
neo/tests/storage/testStorageDBTests.py
neo/tests/storage/testStorageDBTests.py
+1
-1
neo/tests/storage/testStorageMySQL.py
neo/tests/storage/testStorageMySQL.py
+1
-1
neo/tests/storage/testStorageSQLite.py
neo/tests/storage/testStorageSQLite.py
+1
-1
No files found.
neo/storage/app.py
View file @
ea5cdd0b
...
@@ -81,7 +81,7 @@ class Application(object):
...
@@ -81,7 +81,7 @@ class Application(object):
# ready is True when operational and got all informations
# ready is True when operational and got all informations
self
.
ready
=
False
self
.
ready
=
False
self
.
dm
.
setup
(
self
,
reset
=
config
.
getReset
())
self
.
dm
.
setup
(
reset
=
config
.
getReset
())
self
.
loadConfiguration
()
self
.
loadConfiguration
()
# force node uuid from command line argument, for testing purpose only
# force node uuid from command line argument, for testing purpose only
...
...
neo/storage/database/manager.py
View file @
ea5cdd0b
...
@@ -55,15 +55,15 @@ class DatabaseManager(object):
...
@@ -55,15 +55,15 @@ class DatabaseManager(object):
"""Called during instanciation, to process database parameter."""
"""Called during instanciation, to process database parameter."""
pass
pass
def
setup
(
self
,
app
,
reset
=
0
):
def
setup
(
self
,
reset
=
0
):
"""Set up a database, discarding existing data first if reset is True
"""Set up a database, discarding existing data first if reset is True
"""
"""
if
reset
:
if
reset
:
self
.
erase
()
self
.
erase
()
self
.
_uncommitted_data
=
defaultdict
(
int
)
self
.
_uncommitted_data
=
defaultdict
(
int
)
self
.
_setup
(
app
)
self
.
_setup
()
def
_setup
(
self
,
app
):
def
_setup
(
self
):
"""To be overriden by the backend to set up a database
"""To be overriden by the backend to set up a database
It must recover self._uncommitted_data from temporary object table.
It must recover self._uncommitted_data from temporary object table.
...
...
neo/storage/database/mysqldb.py
View file @
ea5cdd0b
...
@@ -139,7 +139,7 @@ class MySQLDatabaseManager(DatabaseManager):
...
@@ -139,7 +139,7 @@ class MySQLDatabaseManager(DatabaseManager):
self
.
query
(
self
.
query
(
"DROP TABLE IF EXISTS config, pt, trans, obj, data, ttrans, tobj"
)
"DROP TABLE IF EXISTS config, pt, trans, obj, data, ttrans, tobj"
)
def
_setup
(
self
,
app
):
def
_setup
(
self
):
self
.
_config
.
clear
()
self
.
_config
.
clear
()
q
=
self
.
query
q
=
self
.
query
# The table "config" stores configuration parameters which affect the
# The table "config" stores configuration parameters which affect the
...
...
neo/storage/database/sqlite.py
View file @
ea5cdd0b
...
@@ -105,7 +105,7 @@ class SQLiteDatabaseManager(DatabaseManager):
...
@@ -105,7 +105,7 @@ class SQLiteDatabaseManager(DatabaseManager):
for
t
in
'config'
,
'pt'
,
'trans'
,
'obj'
,
'data'
,
'ttrans'
,
'tobj'
:
for
t
in
'config'
,
'pt'
,
'trans'
,
'obj'
,
'data'
,
'ttrans'
,
'tobj'
:
self
.
query
(
'DROP TABLE IF EXISTS '
+
t
)
self
.
query
(
'DROP TABLE IF EXISTS '
+
t
)
def
_setup
(
self
,
app
):
def
_setup
(
self
):
self
.
_config
.
clear
()
self
.
_config
.
clear
()
q
=
self
.
query
q
=
self
.
query
# The table "config" stores configuration parameters which affect the
# The table "config" stores configuration parameters which affect the
...
...
neo/tests/storage/testStorageDBTests.py
View file @
ea5cdd0b
...
@@ -53,7 +53,7 @@ class StorageDBTests(NeoUnitTestBase):
...
@@ -53,7 +53,7 @@ class StorageDBTests(NeoUnitTestBase):
self
.
_db
=
db
=
self
.
getDB
(
reset
)
self
.
_db
=
db
=
self
.
getDB
(
reset
)
else
:
else
:
if
reset
:
if
reset
:
db
.
setup
(
None
,
reset
)
db
.
setup
(
reset
)
else
:
else
:
try
:
try
:
n
=
db
.
getNumPartitions
()
n
=
db
.
getNumPartitions
()
...
...
neo/tests/storage/testStorageMySQL.py
View file @
ea5cdd0b
...
@@ -31,7 +31,7 @@ class StorageMySQSLdbTests(StorageDBTests):
...
@@ -31,7 +31,7 @@ class StorageMySQSLdbTests(StorageDBTests):
# db manager
# db manager
database
=
'%s@%s'
%
(
NEO_SQL_USER
,
NEO_SQL_DATABASE
)
database
=
'%s@%s'
%
(
NEO_SQL_USER
,
NEO_SQL_DATABASE
)
db
=
MySQLDatabaseManager
(
database
,
0
)
db
=
MySQLDatabaseManager
(
database
,
0
)
db
.
setup
(
None
,
reset
)
db
.
setup
(
reset
)
return
db
return
db
def
test_MySQLDatabaseManagerInit
(
self
):
def
test_MySQLDatabaseManagerInit
(
self
):
...
...
neo/tests/storage/testStorageSQLite.py
View file @
ea5cdd0b
...
@@ -22,7 +22,7 @@ class StorageSQLiteTests(StorageDBTests):
...
@@ -22,7 +22,7 @@ class StorageSQLiteTests(StorageDBTests):
def
getDB
(
self
,
reset
=
0
):
def
getDB
(
self
,
reset
=
0
):
db
=
SQLiteDatabaseManager
(
':memory:'
,
0
)
db
=
SQLiteDatabaseManager
(
':memory:'
,
0
)
db
.
setup
(
None
,
reset
)
db
.
setup
(
reset
)
return
db
return
db
del
StorageDBTests
del
StorageDBTests
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment