Bug 2244: Set config subsystem service element namespace 81/37481/3
authorAndrej Mak <andmak@cisco.com>
Tue, 12 Apr 2016 08:19:40 +0000 (10:19 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Tue, 19 Apr 2016 14:26:50 +0000 (14:26 +0000)
Change-Id: Ia2dca873d6447c5adb539dee1376718e405727d7
Signed-off-by: Andrej Mak <andmak@cisco.com>
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/config/Services.java

index e3505e4..2f0d73e 100644 (file)
@@ -142,14 +142,15 @@ public final class Services {
     }
 
     public static Element toXml(ServiceRegistryWrapper serviceRegistryWrapper, Document document) {
-        Element root = XmlUtil.createElement(document, XmlMappingConstants.SERVICES_KEY, Optional.of(XmlMappingConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG));
+        final Optional<String> configNs = Optional.of(XmlMappingConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG);
+        Element root = XmlUtil.createElement(document, XmlMappingConstants.SERVICES_KEY, configNs);
 
         Map<String, Map<String, Map<String, String>>> mappedServices = serviceRegistryWrapper.getMappedServices();
         for (Entry<String, Map<String, Map<String, String>>> namespaceToRefEntry : mappedServices.entrySet()) {
 
             for (Entry<String, Map<String, String>> serviceEntry : namespaceToRefEntry.getValue().entrySet()) {
                 // service belongs to config.yang namespace
-                Element serviceElement = XmlUtil.createElement(document, SERVICE_KEY, Optional.<String>absent());
+                Element serviceElement = XmlUtil.createElement(document, SERVICE_KEY, configNs);
                 root.appendChild(serviceElement);
 
                 // type belongs to config.yang namespace