diff options
Diffstat (limited to 'framework/src/onos/cli')
5 files changed, 18 insertions, 10 deletions
diff --git a/framework/src/onos/cli/src/main/java/org/onosproject/cli/Comparators.java b/framework/src/onos/cli/src/main/java/org/onosproject/cli/Comparators.java index 1df2f049..03d25cee 100644 --- a/framework/src/onos/cli/src/main/java/org/onosproject/cli/Comparators.java +++ b/framework/src/onos/cli/src/main/java/org/onosproject/cli/Comparators.java @@ -71,7 +71,10 @@ public final class Comparators { public static final Comparator<FlowRule> FLOW_RULE_COMPARATOR = new Comparator<FlowRule>() { @Override public int compare(FlowRule f1, FlowRule f2) { - return Long.valueOf(f1.id().value()).compareTo(f2.id().value()); + int tableCompare = Integer.valueOf(f1.tableId()).compareTo(f2.tableId()); + return (tableCompare == 0) + ? Long.valueOf(f1.id().value()).compareTo(f2.id().value()) + : tableCompare; } }; diff --git a/framework/src/onos/cli/src/main/java/org/onosproject/cli/net/AddOpticalIntentCommand.java b/framework/src/onos/cli/src/main/java/org/onosproject/cli/net/AddOpticalIntentCommand.java index 57c41009..1049d90d 100644 --- a/framework/src/onos/cli/src/main/java/org/onosproject/cli/net/AddOpticalIntentCommand.java +++ b/framework/src/onos/cli/src/main/java/org/onosproject/cli/net/AddOpticalIntentCommand.java @@ -44,12 +44,12 @@ public class AddOpticalIntentCommand extends ConnectivityIntentCommand { @Argument(index = 0, name = "ingressDevice", description = "Ingress Device/Port Description", required = true, multiValued = false) - String ingressDeviceString = null; + String ingressDeviceString = ""; @Argument(index = 1, name = "egressDevice", description = "Egress Device/Port Description", required = true, multiValued = false) - String egressDeviceString = null; + String egressDeviceString = ""; @Option(name = "-b", aliases = "--bidirectional", description = "If this argument is passed the optical link created will be bidirectional, " + @@ -65,7 +65,6 @@ public class AddOpticalIntentCommand extends ConnectivityIntentCommand { "Connect point must be in \"deviceUri/portNumber\" format"); DeviceId deviceId = DeviceId.deviceId(splitted[0]); - DeviceService deviceService = get(DeviceService.class); List<Port> ports = deviceService.getPorts(deviceId); @@ -87,7 +86,8 @@ public class AddOpticalIntentCommand extends ConnectivityIntentCommand { ConnectPoint egress = createConnectPoint(egressDeviceString); if (ingress == null || egress == null) { - print("Could not create optical intent"); + print("Invalid endpoint(s); could not create optical intent"); + return; } DeviceService deviceService = get(DeviceService.class); diff --git a/framework/src/onos/cli/src/main/java/org/onosproject/cli/net/FlowsListCommand.java b/framework/src/onos/cli/src/main/java/org/onosproject/cli/net/FlowsListCommand.java index de84f519..331cca17 100644 --- a/framework/src/onos/cli/src/main/java/org/onosproject/cli/net/FlowsListCommand.java +++ b/framework/src/onos/cli/src/main/java/org/onosproject/cli/net/FlowsListCommand.java @@ -123,8 +123,14 @@ public class FlowsListCommand extends AbstractShellCommand { if (state != null && !state.equals("any")) { s = FlowEntryState.valueOf(state.toUpperCase()); } - Iterable<Device> devices = uri == null ? deviceService.getDevices() : - Collections.singletonList(deviceService.getDevice(DeviceId.deviceId(uri))); + Iterable<Device> devices = null; + if (uri == null) { + devices = deviceService.getDevices(); + } else { + Device dev = deviceService.getDevice(DeviceId.deviceId(uri)); + devices = (dev == null) ? deviceService.getDevices() + : Collections.singletonList(dev); + } for (Device d : devices) { if (s == null) { rules = newArrayList(service.getFlowEntries(d.id())); diff --git a/framework/src/onos/cli/src/main/java/org/onosproject/cli/net/GroupsListCommand.java b/framework/src/onos/cli/src/main/java/org/onosproject/cli/net/GroupsListCommand.java index afbcab80..b10621de 100644 --- a/framework/src/onos/cli/src/main/java/org/onosproject/cli/net/GroupsListCommand.java +++ b/framework/src/onos/cli/src/main/java/org/onosproject/cli/net/GroupsListCommand.java @@ -46,7 +46,7 @@ import static com.google.common.collect.Lists.newArrayList; public class GroupsListCommand extends AbstractShellCommand { private static final String FORMAT = - " id=%s, state=%s, bytes=%s, packets=%s, appId=%s"; + " id=%s, state=%s, type=%s, bytes=%s, packets=%s, appId=%s"; private static final String BUCKET_FORMAT = " id=%s, bucket=%s, bytes=%s, packets=%s, actions=%s"; @@ -121,7 +121,7 @@ public class GroupsListCommand extends AbstractShellCommand { private void printGroups(DeviceId deviceId, List<Group> groups) { print("deviceId=%s", deviceId); for (Group group : groups) { - print(FORMAT, group.id().id(), group.state(), + print(FORMAT, group.id().id(), group.state(), group.type(), group.bytes(), group.packets(), group.appId().name()); int i = 0; for (GroupBucket bucket:group.buckets().buckets()) { diff --git a/framework/src/onos/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/framework/src/onos/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml index cf76febe..9bd5dd9f 100644 --- a/framework/src/onos/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml +++ b/framework/src/onos/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml @@ -19,7 +19,6 @@ <command> <action class="org.onosproject.cli.SummaryCommand"/> </command> - <command> <action class="org.onosproject.cli.security.ReviewCommand"/> <completers> |