From 643ee33289bd2cb9e6afbfb09b4ed72d467ba1c2 Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Tue, 3 Nov 2015 14:08:10 -0800 Subject: This updates ONOS src tree to commit id 03fa5e571cabbd001ddb1598847e1150b11c7333 Change-Id: I13b554026d6f902933e35887d29bd5fdb669c0bd Signed-off-by: Ashlee Young --- .../cli/src/main/java/org/onosproject/cli/Comparators.java | 5 ++++- .../java/org/onosproject/cli/net/AddOpticalIntentCommand.java | 8 ++++---- .../main/java/org/onosproject/cli/net/FlowsListCommand.java | 10 ++++++++-- .../main/java/org/onosproject/cli/net/GroupsListCommand.java | 4 ++-- .../cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml | 1 - 5 files changed, 18 insertions(+), 10 deletions(-) (limited to 'framework/src/onos/cli') 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 FLOW_RULE_COMPARATOR = new Comparator() { @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 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 devices = uri == null ? deviceService.getDevices() : - Collections.singletonList(deviceService.getDevice(DeviceId.deviceId(uri))); + Iterable 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 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 @@ - -- cgit 1.2.3-korg