From: Suresh Balakrishnan Date: Fri, 30 Sep 2016 07:47:25 +0000 (-0400) Subject: Bug 69 - Change user keypair to be a list of refs instead of inline list for users... X-Git-Tag: v1.0.0~5 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F48%2F448%2F1;p=osm%2FSO.git Bug 69 - Change user keypair to be a list of refs instead of inline list for users in ns-instance-config Signed-off-by: Suresh Balakrishnan --- diff --git a/models/plugins/yang/nsr.yang b/models/plugins/yang/nsr.yang index c6bb4ec9..c2b7d06b 100644 --- a/models/plugins/yang/nsr.yang +++ b/models/plugins/yang/nsr.yang @@ -98,7 +98,9 @@ module nsr leaf key-pair-ref { description "A reference to the key pair entry in the global key pair table"; - type string; + type leafref { + path "/nsr:key-pair/nsr:name"; + } } } list user { @@ -113,19 +115,17 @@ module nsr description "The user name's real name"; type string; } - list key-pair { - key "name"; - description "Used to configure the list of public keys to be injected as part - of ns instantiation"; + list ssh-authorized-key { + key "key-pair-ref"; - leaf name { - description "Name of this key pair"; - type string; - } + description "Used to configure the list of public keys to be injected as part + of ns instantiation"; - leaf key { - description "Key associated with this key pair"; - type string; + leaf key-pair-ref { + description "A reference to the key pair entry in the global key pair table"; + type leafref { + path "/nsr:key-pair/nsr:name"; + } } } } @@ -157,7 +157,9 @@ module nsr leaf nsd-ref { description "Reference to NSR ID ref"; mandatory true; - type string; + type leafref { + path "/nsd:nsd-catalog/nsd:nsd/nsd:id"; + } } uses ns-instance-config-params; } diff --git a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py index 5f30493b..1537b3d9 100644 --- a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py +++ b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py @@ -309,8 +309,9 @@ class OpenmanoNsr(object): user = {} user["name"] = user_entry.name user["key-pairs"] = list() - for ssh_key in user_entry.key_pair: - user["key-pairs"].append(ssh_key.key) + for ssh_key in user_entry.ssh_authorized_key: + if ssh_key.key_pair_ref in self._key_pairs: + user["key-pairs"].append(self._key_pairs[ssh_key.key_pair_ref].key) users.append(user) for user_entry in self._nsd_msg.user: