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
a7881b3c
Commit
a7881b3c
authored
Jul 24, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
neoctl: fix commands expecting an UUID
parent
86f64828
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
neo/neoctl/app.py
neo/neoctl/app.py
+7
-4
No files found.
neo/neoctl/app.py
View file @
a7881b3c
...
@@ -18,7 +18,7 @@ from operator import itemgetter
...
@@ -18,7 +18,7 @@ from operator import itemgetter
from
.neoctl
import
NeoCTL
,
NotReadyException
from
.neoctl
import
NeoCTL
,
NotReadyException
from
neo.lib.util
import
bin
,
p64
from
neo.lib.util
import
bin
,
p64
from
neo.lib.protocol
import
uuid_str
,
ClusterStates
,
NodeStates
,
NodeTypes
,
\
from
neo.lib.protocol
import
uuid_str
,
ClusterStates
,
NodeStates
,
NodeTypes
,
\
ZERO_TID
UUID_NAMESPACES
,
ZERO_TID
action_dict
=
{
action_dict
=
{
'print'
:
{
'print'
:
{
...
@@ -37,6 +37,10 @@ action_dict = {
...
@@ -37,6 +37,10 @@ action_dict = {
'drop'
:
'dropNode'
,
'drop'
:
'dropNode'
,
}
}
uuid_int
=
(
lambda
ns
:
lambda
uuid
:
(
ns
[
uuid
[
0
]]
<<
24
)
+
int
(
uuid
[
1
:])
)(
dict
((
str
(
k
)[
0
],
v
)
for
k
,
v
in
UUID_NAMESPACES
.
iteritems
()))
class
TerminalNeoCTL
(
object
):
class
TerminalNeoCTL
(
object
):
def
__init__
(
self
,
address
):
def
__init__
(
self
,
address
):
self
.
neoctl
=
NeoCTL
(
address
)
self
.
neoctl
=
NeoCTL
(
address
)
...
@@ -54,8 +58,7 @@ class TerminalNeoCTL(object):
...
@@ -54,8 +58,7 @@ class TerminalNeoCTL(object):
def
asClusterState
(
self
,
value
):
def
asClusterState
(
self
,
value
):
return
getattr
(
ClusterStates
,
value
.
upper
())
return
getattr
(
ClusterStates
,
value
.
upper
())
def
asNode
(
self
,
value
):
asNode
=
staticmethod
(
uuid_int
)
return
bin
(
value
)
def
formatRowList
(
self
,
row_list
):
def
formatRowList
(
self
,
row_list
):
return
'
\
n
'
.
join
(
'%03d | %s'
%
(
offset
,
return
'
\
n
'
.
join
(
'%03d | %s'
%
(
offset
,
...
@@ -201,7 +204,7 @@ class TerminalNeoCTL(object):
...
@@ -201,7 +204,7 @@ class TerminalNeoCTL(object):
except
StopIteration
:
except
StopIteration
:
pass
pass
break
break
source
=
bin
(
source
)
if
source
else
None
source
=
self
.
asNode
(
source
)
if
source
else
None
if
partition
:
if
partition
:
partition_dict
[
int
(
partition
)]
=
source
partition_dict
[
int
(
partition
)]
=
source
else
:
else
:
...
...
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