summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-07-21 15:53:33 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-07-25 09:05:08 +0000
commit32e03308ab9f232f38d4495847766e713791e1db (patch)
treeabb6d56ae73ae8d2f2667c09aafb93385ba4fa1e
parent9e9cf0e506b3da8a101700401d3a1cebc1f27656 (diff)
Fix Subinterface acl initalizer NPE
Change-Id: Ibd1b1cf66d702e440c2a575f69a977347f638e17 Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/SubInterfaceInitializationUtils.java12
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppClasifierInitializer.java9
2 files changed, 11 insertions, 10 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/SubInterfaceInitializationUtils.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/SubInterfaceInitializationUtils.java
index 51adcc8f5..aa717cf98 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/SubInterfaceInitializationUtils.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/SubInterfaceInitializationUtils.java
@@ -78,11 +78,13 @@ final class SubInterfaceInitializationUtils {
subInterfaceCfgBuilder.setIpv4(operationalData.getIpv4());
subInterfaceCfgBuilder.setIpv6(operationalData.getIpv6());
- final AclBuilder aclBuilder = new AclBuilder();
- aclBuilder.setL2Acl(operationalData.getAcl().getL2Acl());
- aclBuilder.setIp4Acl(operationalData.getAcl().getIp4Acl());
- aclBuilder.setIp6Acl(operationalData.getAcl().getIp6Acl());
- subInterfaceCfgBuilder.setAcl(aclBuilder.build());
+ if (operationalData.getAcl() != null) {
+ final AclBuilder aclBuilder = new AclBuilder();
+ aclBuilder.setL2Acl(operationalData.getAcl().getL2Acl());
+ aclBuilder.setIp4Acl(operationalData.getAcl().getIp4Acl());
+ aclBuilder.setIp6Acl(operationalData.getAcl().getIp6Acl());
+ subInterfaceCfgBuilder.setAcl(aclBuilder.build());
+ }
return subInterfaceCfgBuilder.build();
}
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppClasifierInitializer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppClasifierInitializer.java
index 74a1cfdee..0881f1aee 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppClasifierInitializer.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppClasifierInitializer.java
@@ -17,13 +17,11 @@
package io.fd.honeycomb.v3po.translate.v3po.initializers;
import io.fd.honeycomb.v3po.vpp.data.init.AbstractDataTreeConverter;
-import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.VppClassifier;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.VppClassifierBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.VppClassifierState;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.vpp.classifier.ClassifyTableBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
@@ -41,9 +39,10 @@ public class VppClasifierInitializer extends AbstractDataTreeConverter<VppClassi
@Override
protected VppClassifier convert(final VppClassifierState operationalData) {
final VppClassifierBuilder builder = new VppClassifierBuilder();
- builder.setClassifyTable(operationalData.getClassifyTable().stream()
- .map(oper -> new ClassifyTableBuilder(oper).build())
- .collect(Collectors.toList()));
+ // TODO finish translation classify table key + mandatory fields at least must be set
+// builder.setClassifyTable(operationalData.getClassifyTable().stream()
+// .map(oper -> new ClassifyTableBuilder(oper).build())
+// .collect(Collectors.toList()));
return builder.build();
}
}