Bug 94 - SDN and Cloud/Config-Agent account data inconsistent

Signed-off-by: Rajesh Velandy <rajesh.velandy@riftio.com>
diff --git a/common/plugins/yang/rw-cloud.yang b/common/plugins/yang/rw-cloud.yang
index e4682ac..2c7ce6f 100644
--- a/common/plugins/yang/rw-cloud.yang
+++ b/common/plugins/yang/rw-cloud.yang
@@ -60,7 +60,7 @@
       leaf sdn-account {
         description "Configured SDN account associated with this cloud account";
         type leafref {
-          path "/rw-sdn:sdn-account/rw-sdn:name";
+          path "/rw-sdn:sdn/rw-sdn:account/rw-sdn:name";
         }
       }
 
diff --git a/common/plugins/yang/rw-sdn.tailf.yang b/common/plugins/yang/rw-sdn.tailf.yang
index c8a4d46..3f63883 100644
--- a/common/plugins/yang/rw-sdn.tailf.yang
+++ b/common/plugins/yang/rw-sdn.tailf.yang
@@ -30,7 +30,7 @@
     prefix tailf-common;
   }
 
-  tailf-common:annotate "/rw-sdn:sdn-account/rw-sdn:connection-status" {
+  tailf:annotate "/rw-sdn:sdn/rw-sdn:account/rw-sdn:connection-status" {
     tailf-common:callpoint rw_callpoint;
   }
 
diff --git a/common/plugins/yang/rw-sdn.yang b/common/plugins/yang/rw-sdn.yang
index 0a5b228..6475cc5 100644
--- a/common/plugins/yang/rw-sdn.yang
+++ b/common/plugins/yang/rw-sdn.yang
@@ -25,7 +25,7 @@
 
 
   import rw-pb-ext {
-    prefix "rw-pb-ext";
+    prefix "rwpb";
   }
 
   import rwsdn {
@@ -37,16 +37,17 @@
       "Initial revision.";
   }
 
-  list sdn-account {
-    rw-pb-ext:msg-new SDNAccountConfig;
+  container sdn {
+    list account {
+      rwpb:msg-new SDNAccountConfig;
+      key "name";
+      leaf name {
+	type string;
+      }
 
-    key "name";
-    leaf name {
-      type string;
+      uses rwsdn:sdn-provider-auth;
+      uses rwsdn:connection-status;
     }
-
-    uses rwsdn:sdn-provider-auth;
-    uses rwsdn:connection-status;
   }
 
   rpc update-sdn-status {
diff --git a/models/plugins/yang/nsr.yang b/models/plugins/yang/nsr.yang
index c2b7d06..da33f9e 100644
--- a/models/plugins/yang/nsr.yang
+++ b/models/plugins/yang/nsr.yang
@@ -133,7 +133,7 @@
 
   list key-pair {
     key "name";
-    description "Used to configure the list of public keys to be injected as part 
+    description "Used to configure the list of public keys to be injected as part
                  of ns instantiation";
     leaf name {
       description "Name of this key pair";
@@ -151,7 +151,7 @@
     input {
       leaf name {
         mandatory true;
-        description "Name of the Network Service"; 
+        description "Name of the Network Service";
         type string;
       }
       leaf nsd-ref {
@@ -265,8 +265,8 @@
     key "placement-group-ref vnfd-id-ref";
 
     leaf vnfd-id-ref {
-      description 
-          "A reference to a vnfd. This is a 
+      description
+          "A reference to a vnfd. This is a
           leafref to path:
           ../../../../nsd:constituent-vnfd
           + [nsr:id = current()/../nsd:id-ref]
@@ -327,7 +327,7 @@
             "The SDN account to use when requesting resources for
             this vnffgr";
         type leafref {
-          path "/rwsdn:sdn-account/rwsdn:name";
+          path "/rwsdn:sdn/rwsdn:account/rwsdn:name";
         }
       }
 
diff --git a/models/plugins/yang/rw-nsr.yang b/models/plugins/yang/rw-nsr.yang
index ae2c92a..805ed00 100644
--- a/models/plugins/yang/rw-nsr.yang
+++ b/models/plugins/yang/rw-nsr.yang
@@ -64,8 +64,8 @@
       key "id";
       description
         "Recent operational events for this network service.
-        Though the model does not impose any restrictions on the numbe of events, 
-        the max operational events will be limited to the most recent 10"; 
+        Though the model does not impose any restrictions on the numbe of events,
+        the max operational events will be limited to the most recent 10";
 
       leaf id {
         description "The id of the instance";
@@ -137,9 +137,9 @@
          by multiple cloud accounts when that becomes available.";
       type string;
     }
-      
+
     list vnf-cloud-account-map {
-      description 
+      description
           "Mapping VNF to Cloud Account where VNF will be instantiated";
 
       key "member-vnf-index-ref";
@@ -178,13 +178,13 @@
     }
 
     list vl-cloud-account-map {
-      description 
+      description
           "Mapping VL to Cloud Account where VL will be instantiated";
 
       key "vld-id-ref";
 
       leaf vld-id-ref {
-        description 
+        description
             "A reference to a vld.
             leafref path ../../nsd/vld/id";
         type string;
@@ -218,7 +218,7 @@
 
   augment /nsr:start-network-service/nsr:input{
     uses rw-ns-instance-config;
-  } 
+  }
 
   augment /nsr:ns-instance-opdata/nsr:nsr {
     uses manotypes:action-param;
@@ -229,7 +229,7 @@
         "The SDN account associted with the cloud account using which an
          NS was instantiated.";
       type leafref {
-        path "/rw-sdn:sdn-account/rw-sdn:name";
+        path "/rw-sdn:sdn/rw-sdn:account/rw-sdn:name";
       }
     }
 
@@ -438,7 +438,7 @@
 
   notification nsm-notification {
     description "Notification for NSM Events.
-        The timestamp of this event is automatically expressed 
+        The timestamp of this event is automatically expressed
         in human readble format - 1970-01-01T00:00:00Z";
 
     leaf event {
diff --git a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwvnffgmgr.py b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwvnffgmgr.py
index 0ebe9df..cf83612 100755
--- a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwvnffgmgr.py
+++ b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwvnffgmgr.py
@@ -190,7 +190,7 @@
                 vnfr.mgmt_address = cp_ref.connection_point_params.mgmt_address
                 vnfr.mgmt_port = 5000
                 vnfr_list.append(vnfr)
-            
+
                 vdu = vnfr.vdu_list.add()
                 vdu.name = cp_ref.connection_point_params.name
                 vdu.port_id = cp_ref.connection_point_params.port_id
@@ -220,9 +220,9 @@
         if(len(classifier_list) == 2):
             meta[vnffgr.classifier[0].id] = '0x' + ''.join(str("%0.2X"%int(i)) for i in vnffgr.classifier[1].ip_address.split('.'))
             meta[vnffgr.classifier[1].id] = '0x' + ''.join(str("%0.2X"%int(i)) for i in vnffgr.classifier[0].ip_address.split('.'))
-            
+
         self._log.debug("VNFFG Meta VNFFG chain is {}".format(meta))
-        
+
         for classifier in classifier_list:
             vnffgr_cl = [_classifier  for _classifier in vnffgr.classifier if classifier.id == _classifier.id]
             if len(vnffgr_cl) > 0:
@@ -236,8 +236,8 @@
             vnffgcl.port_id = vnffgr_cl[0].port_id
             vnffgcl.vm_id = vnffgr_cl[0].vm_id
             # Get the symmetric classifier endpoint ip and set it in nsh ctx1
-            
-            vnffgcl.vnffg_metadata.ctx1 =  meta.get(vnffgr_cl[0].id,'0') 
+
+            vnffgcl.vnffg_metadata.ctx1 =  meta.get(vnffgr_cl[0].id,'0')
             vnffgcl.vnffg_metadata.ctx2 = '0'
             vnffgcl.vnffg_metadata.ctx3 = '0'
             vnffgcl.vnffg_metadata.ctx4 = '0'
@@ -323,7 +323,7 @@
         del self._vnffgr_list[vnffgr_id]
 
 class SDNAccountDtsHandler(object):
-    XPATH = "C,/rw-sdn:sdn-account"
+    XPATH = "C,/rw-sdn:sdn/rw-sdn:account"
 
     def __init__(self, dts, log, parent):
         self._dts = dts
diff --git a/rwlaunchpad/plugins/rwvns/rift/tasklets/rwvnstasklet/rwvnstasklet.py b/rwlaunchpad/plugins/rwvns/rift/tasklets/rwvnstasklet/rwvnstasklet.py
index 1f88824..0ced574 100755
--- a/rwlaunchpad/plugins/rwvns/rift/tasklets/rwvnstasklet/rwvnstasklet.py
+++ b/rwlaunchpad/plugins/rwvns/rift/tasklets/rwvnstasklet/rwvnstasklet.py
@@ -82,7 +82,7 @@
 
     def _register_show_status(self):
         def get_xpath(sdn_name=None):
-            return "D,/rw-sdn:sdn-account{}/rw-sdn:connection-status".format(
+            return "D,/rw-sdn:sdn/rw-sdn:account{}/rw-sdn:connection-status".format(
                     "[name='%s']" % sdn_name if sdn_name is not None else ''
                    )
 
@@ -152,7 +152,7 @@
         yield from self._register_validate_rpc()
 
 class SDNAccountDtsHandler(object):
-    XPATH = "C,/rw-sdn:sdn-account"
+    XPATH = "C,/rw-sdn:sdn/rw-sdn:account"
 
     def __init__(self, dts, log, parent):
         self._dts = dts