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
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
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
Show 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
from
.neoctl
import
NeoCTL
,
NotReadyException
from
neo.lib.util
import
bin
,
p64
from
neo.lib.protocol
import
uuid_str
,
ClusterStates
,
NodeStates
,
NodeTypes
,
\
ZERO_TID
UUID_NAMESPACES
,
ZERO_TID
action_dict
=
{
'print'
:
{
...
...
@@ -37,6 +37,10 @@ action_dict = {
'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
):
def
__init__
(
self
,
address
):
self
.
neoctl
=
NeoCTL
(
address
)
...
...
@@ -54,8 +58,7 @@ class TerminalNeoCTL(object):
def
asClusterState
(
self
,
value
):
return
getattr
(
ClusterStates
,
value
.
upper
())
def
asNode
(
self
,
value
):
return
bin
(
value
)
asNode
=
staticmethod
(
uuid_int
)
def
formatRowList
(
self
,
row_list
):
return
'
\
n
'
.
join
(
'%03d | %s'
%
(
offset
,
...
...
@@ -201,7 +204,7 @@ class TerminalNeoCTL(object):
except
StopIteration
:
pass
break
source
=
bin
(
source
)
if
source
else
None
source
=
self
.
asNode
(
source
)
if
source
else
None
if
partition
:
partition_dict
[
int
(
partition
)]
=
source
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