Skip to content

Commit

Permalink
Fix breeze kvstore nodes oputput
Browse files Browse the repository at this point in the history
Summary:
Description:
- `breeze kvstore nodes` returned ugly output because the original code extended a list of string objects with a unicode object (`prefix_strs`).
- Fixed it so as to pass a properly formatted list of loopback addresses as an argument instead of `prefix_strs`.
Closes #12

Differential Revision: D6478638

Pulled By: saifhhasan

fbshipit-source-id: 2695d7f86ce65f9babb908da321ff988ceb0be5f
  • Loading branch information
tamihiro authored and facebook-github-bot committed Dec 4, 2017
1 parent 4624e9c commit c71003b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions openr/py/openr/cli/commands/kvstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,11 @@ def print_kvstore_nodes(self, resp, host_id):
def _parse_nodes(rows, value):
prefix_db = deserialize_thrift_object(value.value,
lsdb_types.PrefixDatabase)

prefix_strs = utils.sprint_prefixes_db_full(prefix_db, True)

marker = '* ' if prefix_db.thisNodeName == host_id else '> '
row = ["{}{}".format(marker, prefix_db.thisNodeName)]
row.extend(prefix_strs)
loopback_prefixes = [p.prefix for p in prefix_db.prefixEntries \
if p.type == lsdb_types.PrefixType.LOOPBACK]
row.extend([utils.sprint_prefix(p) for p in loopback_prefixes])
rows.append(row)

rows = []
Expand Down

0 comments on commit c71003b

Please sign in to comment.