Print device ID in packet-requests command
Change-Id: Ifec27e92c73ddcb6c5c0cf0ac308bdb978ccf01b
(cherry picked from commit 207e55b0bd508ca777a02dcc1d6c65fe3ec6ea07)
diff --git a/cli/src/main/java/org/onosproject/cli/net/PacketRequestsListCommand.java b/cli/src/main/java/org/onosproject/cli/net/PacketRequestsListCommand.java
index ae6418d..f3bfc61 100644
--- a/cli/src/main/java/org/onosproject/cli/net/PacketRequestsListCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/PacketRequestsListCommand.java
@@ -32,7 +32,7 @@
description = "Lists packet requests")
public class PacketRequestsListCommand extends AbstractShellCommand {
- private static final String FMT = "nodeId=%s appId=%s, priority=%s, criteria=%s";
+ private static final String FMT = "nodeId=%s appId=%s, priority=%s, criteria=%s, deviceId=%s";
@Override
protected void execute() {
@@ -53,14 +53,16 @@
.put("nodeId", r.nodeId().toString())
.put("appId", r.appId().name())
.put("priority", r.priority().toString())
- .put("criteria", r.selector().criteria().toString()));
+ .put("criteria", r.selector().criteria().toString())
+ .put("deviceId", r.deviceId().isPresent() ? r.deviceId().get().toString() : "ALL"));
}
return result;
}
private void print(PacketRequest request) {
- print(FMT, request.nodeId(), request.appId().name(), request.priority(), request.selector().criteria());
+ print(FMT, request.nodeId(), request.appId().name(), request.priority(), request.selector().criteria(),
+ request.deviceId().isPresent() ? request.deviceId().get().toString() : "ALL");
}
}