summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp
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
commit8f4bd2d7fc29e656ec6207842cf5e5adeae9d1ac (patch)
tree468cfc212b7b736ac3328cb8c1d01dcbf9fe7759 /v3po/v3po2vpp
parent65eb39d27d723a91f583f93c88c21017ee58d04e (diff)
Fix Subinterface acl initalizer NPE
Change-Id: Ibd1b1cf66d702e440c2a575f69a977347f638e17 Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp')
-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();
}
}