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 {
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";
+ }
}
}
}
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;
}
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: