Merge "Hotfix for resolving of remote yang schemas."
authorTony Tkacik <ttkacik@cisco.com>
Wed, 3 Sep 2014 09:21:38 +0000 (09:21 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 3 Sep 2014 09:21:38 +0000 (09:21 +0000)
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfStateSchemas.java

index 23b039c2542540fe39d7af70b8ea0b0129e11aa3..e0b774f53c9008e3d8bd25772128e770b247419a 100644 (file)
@@ -156,7 +156,13 @@ public final class NetconfStateSchemas {
 
             QName childNode = NetconfMessageTransformUtil.IETF_NETCONF_MONITORING_SCHEMA_FORMAT.withoutRevision();
 
-            final String formatAsString = getSingleChildNodeValue(schemaNode, childNode).get();
+            String formatAsString = getSingleChildNodeValue(schemaNode, childNode).get();
+            //This is HotFix for situations where format statement in netconf-monitoring might be passed with prefix.
+            if (formatAsString.contains(":")) {
+                String[] prefixedString = formatAsString.split(":");
+                //FIXME: might be good idea to check prefix against model namespace
+                formatAsString = prefixedString[1];
+            }
             if(formatAsString.equals(Yang.QNAME.getLocalName()) == false) {
                 logger.debug("{}: Ignoring schema due to unsupported format: {}", id, formatAsString);
                 return Optional.absent();