Fix issues and remove re-registrations.

Change-Id: Ie9edcaabbc8ce755a20e0f01091562800e0fefb1
diff --git a/models/huawei/BUCK b/models/huawei/BUCK
index a57225e..1d8a1d2 100644
--- a/models/huawei/BUCK
+++ b/models/huawei/BUCK
@@ -2,4 +2,6 @@
 yang_model (
   app_name = 'org.onosproject.models.huawei',
   title = 'Huawei YANG Models',
+  custom_registrator = True,
+  deps = [ '//lib:CORE_DEPS' ]
 )
diff --git a/drivers/huawei/src/main/java/org/onosproject/drivers/huawei/HuaweiModelRegistrator.java b/models/huawei/src/main/java/HuaweiModelRegistrator.java
similarity index 90%
rename from drivers/huawei/src/main/java/org/onosproject/drivers/huawei/HuaweiModelRegistrator.java
rename to models/huawei/src/main/java/HuaweiModelRegistrator.java
index 9f175e8..912d068 100644
--- a/drivers/huawei/src/main/java/org/onosproject/drivers/huawei/HuaweiModelRegistrator.java
+++ b/models/huawei/src/main/java/HuaweiModelRegistrator.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.drivers.huawei;
+package org.onosproject.models.huawei;
 
 import com.google.common.collect.ImmutableMap;
 import org.apache.felix.scr.annotations.Component;
@@ -45,24 +45,24 @@
      * Creates L3VPN model registrator.
      */
     public HuaweiModelRegistrator() {
-        super(NeBgpcomm.class, getAppInfo());
+        super(HuaweiModelRegistrator.class, getAppInfo());
     }
 
     private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
         Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
-        appInfo.put(new DefaultYangModuleId("NeBgpcomm.class", "2014-00-25"),
+        appInfo.put(new DefaultYangModuleId("ne-bgpcomm", "2014-12-25"),
                     new DefaultAppModuleInfo(NeBgpcomm.class, null));
-        appInfo.put(new DefaultYangModuleId("ne-bgpcomm-type", "2014-00-25"),
+        appInfo.put(new DefaultYangModuleId("ne-bgpcomm-type", "2014-12-25"),
                     new DefaultAppModuleInfo(NeBgpcommType.class, null));
-        appInfo.put(new DefaultYangModuleId("ne-l3vpn-api", "2014-00-25"),
+        appInfo.put(new DefaultYangModuleId("ne-l3vpn-api", "2014-12-25"),
                     new DefaultAppModuleInfo(NeL3VpnApi.class, null));
-        appInfo.put(new DefaultYangModuleId("ne-l3vpncomm", "2014-00-25"),
+        appInfo.put(new DefaultYangModuleId("ne-l3vpncomm", "2014-12-25"),
                     new DefaultAppModuleInfo(NeL3Vpncomm.class, null));
-        appInfo.put(new DefaultYangModuleId("ne-l3vpncomm-type", "2014-00-25"),
+        appInfo.put(new DefaultYangModuleId("ne-l3vpncomm-type", "2014-12-25"),
                     new DefaultAppModuleInfo(NeL3VpncommType.class, null));
-        appInfo.put(new DefaultYangModuleId("ne-tnlm", "2014-00-25"),
+        appInfo.put(new DefaultYangModuleId("ne-tnlm", "2014-12-25"),
                     new DefaultAppModuleInfo(NeTnlm.class, null));
-        appInfo.put(new DefaultYangModuleId("ne-tnlm-type", "2014-00-25"),
+        appInfo.put(new DefaultYangModuleId("ne-tnlm-type", "2014-12-25"),
                     new DefaultAppModuleInfo(NeTnlmType.class, null));
         return ImmutableMap.copyOf(appInfo);
     }
diff --git a/models/huawei/src/main/java/package-info.java b/models/huawei/src/main/java/package-info.java
new file mode 100644
index 0000000..0169ca5
--- /dev/null
+++ b/models/huawei/src/main/java/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Huawei YANG models.
+ */
+package org.onosproject.models.huawei;
diff --git a/models/l3vpn/BUCK b/models/l3vpn/BUCK
index 8098905..7f6d5b8 100644
--- a/models/l3vpn/BUCK
+++ b/models/l3vpn/BUCK
@@ -1,4 +1,5 @@
 COMPILE_DEPS = [
+    '//lib:CORE_DEPS',
     '//models/common:onos-models-common',
 ]
 
@@ -9,6 +10,7 @@
 yang_model(
     app_name = 'org.onosproject.models.l3vpn',
     title = 'L3VPN YANG Models',
+    custom_registrator = True,
     deps = COMPILE_DEPS,
     required_apps = APPS,
 )
diff --git a/apps/l3vpn/src/main/java/org/onosproject/l3vpn/netl3vpn/impl/L3VpnModelRegistrator.java b/models/l3vpn/src/main/java/org.onosproject.models.l3vpn/L3VpnModelRegistrator.java
similarity index 94%
rename from apps/l3vpn/src/main/java/org/onosproject/l3vpn/netl3vpn/impl/L3VpnModelRegistrator.java
rename to models/l3vpn/src/main/java/org.onosproject.models.l3vpn/L3VpnModelRegistrator.java
index f4744f1..3c34d1b 100644
--- a/apps/l3vpn/src/main/java/org/onosproject/l3vpn/netl3vpn/impl/L3VpnModelRegistrator.java
+++ b/models/l3vpn/src/main/java/org.onosproject.models.l3vpn/L3VpnModelRegistrator.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.l3vpn.netl3vpn.impl;
+package org.onosproject.models.l3vpn;
 
 import com.google.common.collect.ImmutableMap;
 import org.apache.felix.scr.annotations.Component;
@@ -40,7 +40,7 @@
      * Creates L3VPN model registrator.
      */
     public L3VpnModelRegistrator() {
-        super(IetfL3VpnSvc.class, getAppInfo());
+        super(L3VpnModelRegistrator.class, getAppInfo());
     }
 
     private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
diff --git a/models/l3vpn/src/main/java/org.onosproject.models.l3vpn/package-info.java b/models/l3vpn/src/main/java/org.onosproject.models.l3vpn/package-info.java
new file mode 100644
index 0000000..55e1dbb
--- /dev/null
+++ b/models/l3vpn/src/main/java/org.onosproject.models.l3vpn/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * L3vpn YANG models.
+ */
+package org.onosproject.models.l3vpn;