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
04922832
Commit
04922832
authored
Jul 23, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
neoctl: improve output of 'print node'
parent
896900f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
neo/neoctl/app.py
neo/neoctl/app.py
+7
-9
No files found.
neo/neoctl/app.py
View file @
04922832
...
...
@@ -14,6 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
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
,
\
...
...
@@ -62,17 +63,14 @@ class TerminalNeoCTL(object):
for
(
uuid
,
state
)
in
cell_list
))
for
(
offset
,
cell_list
)
in
row_list
)
def
formatNodeList
(
self
,
node_list
):
def
formatNodeList
(
self
,
node_list
,
_sort_key
=
itemgetter
(
2
,
0
,
1
)
):
if
not
node_list
:
return
'Empty list!'
result
=
[]
for
node_type
,
address
,
uuid
,
state
in
node_list
:
if
address
is
None
:
address
=
(
None
,
None
)
ip
,
port
=
address
result
.
append
(
'%s - %s - %s:%s - %s'
%
(
node_type
,
uuid_str
(
uuid
),
ip
,
port
,
state
))
return
'
\
n
'
.
join
(
result
)
node_list
.
sort
(
key
=
_sort_key
)
return
'
\
n
'
.
join
(
'%s - %s - %s - %s'
%
(
node_type
,
uuid_str
(
uuid
),
address
and
'%s:%s'
%
address
,
state
)
for
node_type
,
address
,
uuid
,
state
in
node_list
)
# Actual actions
def
getPartitionRowList
(
self
,
params
):
...
...
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