Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Show output host in cherami-admin list cgExtents #335

Merged
merged 1 commit into from
Nov 29, 2017
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
10 changes: 9 additions & 1 deletion tools/admin/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ type consumerGroupExtentJSONOutputFields struct {
ExtentUUID string `json:"extent_uuid"`
AckLevelOffset int64 `json:"ack_level_offset"`
StoreHosts []string `json:"storehosts"`
OutputHost string `json:"outputhost"`
}

//ListEntityOps lists all CRUD ops related with the destination
Expand Down Expand Up @@ -893,10 +894,17 @@ func ListConsumerGroupExtents(c *cli.Context) {
storeHosts = append(storeHosts, storeHostAddr)
}

outputHostAddr, err := mClient.UUIDToHostAddr(*cgExtent.OutputHostUUID)
if err != nil {
outputHostAddr = *cgExtent.OutputHostUUID + toolscommon.UnknownUUID
}

output := &consumerGroupExtentJSONOutputFields{
ExtentUUID: cgExtent.GetExtentUUID(),
AckLevelOffset: cgExtent.GetAckLevelOffset(),
StoreHosts: storeHosts}
StoreHosts: storeHosts,
OutputHost: outputHostAddr,
}
outputStr, _ := json.Marshal(output)
fmt.Fprintln(os.Stdout, string(outputStr))
}
Expand Down