Skip to content

Commit

Permalink
[pulsar-cli] fix ns-isolation-policy api output (apache#5313)
Browse files Browse the repository at this point in the history
  • Loading branch information
rdhabalia authored and merlimat committed Oct 7, 2019
1 parent e840375 commit de233d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,7 @@ static Set<AuthAction> getAuthActions(List<String> actions) {

<T> void print(List<T> items) {
for (T item : items) {
System.out.println(item);
}
}

<T> void printList(T item) {
try {
System.out.println(writer.writeValueAsString(item));
} catch (Exception e) {
throw new RuntimeException(e);
print(item);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class FunctionsStats extends BaseCommand {

@Override
void runCmd() throws Exception {
printList(admin.worker().getFunctionsStats());
print(admin.worker().getFunctionsStats());
}
}

Expand All @@ -59,7 +59,7 @@ class CmdMonitoringMetrics extends BaseCommand {

@Override
void runCmd() throws Exception {
printList(admin.worker().getMetrics());
print(admin.worker().getMetrics());
}
}

Expand All @@ -68,7 +68,7 @@ class GetCluster extends BaseCommand {

@Override
void runCmd() throws Exception {
printList(admin.worker().getCluster());
print(admin.worker().getCluster());
}
}

Expand Down

0 comments on commit de233d4

Please sign in to comment.