Added commands to list paths.
Added protection against bad input on some command-lines.
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/ClusterDevicesCommand.java b/cli/src/main/java/org/onlab/onos/cli/net/ClusterDevicesCommand.java
index d4d6d24..a6f3048 100644
--- a/cli/src/main/java/org/onlab/onos/cli/net/ClusterDevicesCommand.java
+++ b/cli/src/main/java/org/onlab/onos/cli/net/ClusterDevicesCommand.java
@@ -35,11 +35,16 @@
int cid = Integer.parseInt(id);
init();
TopologyCluster cluster = service.getCluster(topology, clusterId(cid));
- List<DeviceId> ids = Lists.newArrayList(service.getClusterDevices(topology, cluster));
- Collections.sort(ids, ID_COMPARATOR);
- for (DeviceId deviceId : ids) {
- print("%s", deviceId);
+ if (cluster == null) {
+ error("No such cluster %s", cid);
+ } else {
+ List<DeviceId> ids = Lists.newArrayList(service.getClusterDevices(topology, cluster));
+ Collections.sort(ids, ID_COMPARATOR);
+ for (DeviceId deviceId : ids) {
+ print("%s", deviceId);
+ }
}
+
return null;
}