Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion nebula2/mclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
)
from nebula2.common.ttypes import HostAddr, ErrorCode
from nebula2.meta.ttypes import (
HostStatus,
ListTagsReq,
ListEdgesReq,
ListSpacesReq,
Expand Down Expand Up @@ -139,7 +140,11 @@ def list_hosts(self):
continue
raise RuntimeError("List spaces failed, error code: {}"
.format(ErrorCode._VALUES_TO_NAMES.get(resp.code)))
return resp.hosts
valid_hosts = []
for host in resp.hosts:
if host.status == HostStatus.ONLINE:
valid_hosts.append(host)
return valid_hosts
raise RuntimeError("List spaces failed, error code: {}"
.format(ErrorCode._VALUES_TO_NAMES.get(resp.code)))

Expand Down