ONOS-365 Excluding intents with state=null from output.
Change-Id: I96555f6c1483e9d744b7d67bae8d4a221a630f5d
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/IntentsListCommand.java b/cli/src/main/java/org/onlab/onos/cli/net/IntentsListCommand.java
index 7f84207..fbcb5e9 100644
--- a/cli/src/main/java/org/onlab/onos/cli/net/IntentsListCommand.java
+++ b/cli/src/main/java/org/onlab/onos/cli/net/IntentsListCommand.java
@@ -76,10 +76,12 @@
} else {
for (Intent intent : service.getIntents()) {
IntentState state = service.getIntentState(intent.id());
- print("id=%s, state=%s, type=%s, appId=%s",
- intent.id(), state, intent.getClass().getSimpleName(),
- intent.appId().name());
- printDetails(service, intent);
+ if (state != null) {
+ print("id=%s, state=%s, type=%s, appId=%s",
+ intent.id(), state, intent.getClass().getSimpleName(),
+ intent.appId().name());
+ printDetails(service, intent);
+ }
}
}
}