Display the source in routes CLI command
Change-Id: Ic00c7a5dbbaf0d279499796c5067c5ef849c1775
(cherry picked from commit 218b9f314f364b93a84dadaa895c937b7dfdf553)
diff --git a/cli/src/main/java/org/onosproject/cli/net/RoutesListCommand.java b/cli/src/main/java/org/onosproject/cli/net/RoutesListCommand.java
index cb96f4c..780a9ab 100644
--- a/cli/src/main/java/org/onosproject/cli/net/RoutesListCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/RoutesListCommand.java
@@ -43,9 +43,9 @@
private static final String FORMAT_SUMMARY =
"Number of routes in table %s: %s";
private static final String FORMAT_HEADER =
- " Network Next Hop";
+ " Network Next Hop Source";
private static final String FORMAT_ROUTE =
- " %-18s %-15s";
+ " %-18s %-15s %-10s";
private static final String FORMAT_TABLE = "Table: %s";
private static final String FORMAT_TOTAL = " Total: %d";
@@ -80,7 +80,7 @@
allRoutes.forEach((id, routes) -> {
print(FORMAT_TABLE, id);
print(FORMAT_HEADER);
- routes.forEach(r -> print(FORMAT_ROUTE, r.prefix(), r.nextHop()));
+ routes.forEach(r -> print(FORMAT_ROUTE, r.prefix(), r.nextHop(), r.source()));
print(FORMAT_TOTAL, routes.size());
print("");
});