Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
2d35ac93
Commit
2d35ac93
authored
Jan 05, 2012
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop using assertions for actual runtime checks.
parent
c93a786f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
neo/neoctl/neoctl.py
neo/neoctl/neoctl.py
+14
-10
No files found.
neo/neoctl/neoctl.py
View file @
2d35ac93
...
...
@@ -78,8 +78,8 @@ class NeoCTL(object):
"""
packet
=
Packets
.
AddPendingNodes
(
uuid_list
)
response
=
self
.
__ask
(
packet
)
assert
response
[
0
]
==
Packets
.
Error
assert
response
[
1
]
==
ErrorCodes
.
ACK
if
response
[
0
]
!=
Packets
.
Error
or
response
[
1
]
!=
ErrorCodes
.
ACK
:
raise
RuntimeError
(
response
)
return
response
[
2
]
def
setClusterState
(
self
,
state
):
...
...
@@ -88,8 +88,8 @@ class NeoCTL(object):
"""
packet
=
Packets
.
SetClusterState
(
state
)
response
=
self
.
__ask
(
packet
)
assert
response
[
0
]
==
Packets
.
Error
assert
response
[
1
]
==
ErrorCodes
.
ACK
if
response
[
0
]
!=
Packets
.
Error
or
response
[
1
]
!=
ErrorCodes
.
ACK
:
raise
RuntimeError
(
response
)
return
response
[
2
]
def
setNodeState
(
self
,
node
,
state
,
update_partition_table
=
False
):
...
...
@@ -102,8 +102,8 @@ class NeoCTL(object):
update_partition_table
=
0
packet
=
Packets
.
SetNodeState
(
node
,
state
,
update_partition_table
)
response
=
self
.
__ask
(
packet
)
assert
response
[
0
]
==
Packets
.
Error
assert
response
[
1
]
==
ErrorCodes
.
ACK
if
response
[
0
]
!=
Packets
.
Error
or
response
[
1
]
!=
ErrorCodes
.
ACK
:
raise
RuntimeError
(
response
)
return
response
[
2
]
def
getClusterState
(
self
):
...
...
@@ -112,7 +112,8 @@ class NeoCTL(object):
"""
packet
=
Packets
.
AskClusterState
()
response
=
self
.
__ask
(
packet
)
assert
response
[
0
]
==
Packets
.
AnswerClusterState
if
response
[
0
]
!=
Packets
.
AnswerClusterState
:
raise
RuntimeError
(
response
)
return
response
[
1
]
def
getNodeList
(
self
,
node_type
=
None
):
...
...
@@ -121,7 +122,8 @@ class NeoCTL(object):
"""
packet
=
Packets
.
AskNodeList
(
node_type
)
response
=
self
.
__ask
(
packet
)
assert
response
[
0
]
==
Packets
.
AnswerNodeList
if
response
[
0
]
!=
Packets
.
AnswerNodeList
:
raise
RuntimeError
(
response
)
return
response
[
1
]
# node_list
def
getPartitionRowList
(
self
,
min_offset
=
0
,
max_offset
=
0
,
node
=
None
):
...
...
@@ -131,7 +133,8 @@ class NeoCTL(object):
"""
packet
=
Packets
.
AskPartitionList
(
min_offset
,
max_offset
,
node
)
response
=
self
.
__ask
(
packet
)
assert
response
[
0
]
==
Packets
.
AnswerPartitionList
if
response
[
0
]
!=
Packets
.
AnswerPartitionList
:
raise
RuntimeError
(
response
)
return
response
[
1
:
3
]
# ptid, row_list
def
startCluster
(
self
):
...
...
@@ -153,6 +156,7 @@ class NeoCTL(object):
"""
packet
=
Packets
.
AskPrimary
()
response
=
self
.
__ask
(
packet
)
assert
response
[
0
]
==
Packets
.
AnswerPrimary
if
response
[
0
]
!=
Packets
.
AnswerPrimary
:
raise
RuntimeError
(
response
)
return
response
[
1
]
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