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

Commit

Permalink
Show output host in cherami-admin list cgExtents (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
thuningxu authored Nov 29, 2017
1 parent 5ba68b7 commit 02eb433
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit 02eb433

Please sign in to comment.