06-03-2023 04:10 PM
output_result = device.live_status.cisco_ios_xr_stats__exec[live_status_cmd](live_status_action_input)
File "/nso-6.0/src/ncs/pyapi/ncs/maagic.py", line 535, in __getitem__
child = self._children.get_by_yang(self._backend, self, name)
File "/nso-6.0/src/ncs/pyapi/ncs/childlist.py", line 184, in get_by_yang
name = self.full_name_from_short_name(name)
File "/nso-6.0/src/ncs/pyapi/ncs/childlist.py", line 210, in full_name_from_short_name
return self.short_name_to_full_name[short_name]
KeyError: 'auto-prompts { question ".*Enter new key.*" answer mykey12345 } auto-prompts { question ".*Enter confirm key.*" answer mykey12345 } "key config-key password-encryption"'
06-06-2023 10:42 PM - edited 06-06-2023 10:46 PM
Emil Holmström answered this in another place:
-----8><-----
the action looks like this:
tailf:action any {
tailf:info "Execute any command on device";
tailf:actionpoint ncsinternal {
tailf:internal;
}
input {
leaf admin-mode {
tailf:info "Set to run the action in admin mode";
type empty;
}
list auto-prompts {
tailf:info "One-shot auto-prompts list, used to ignore/reply on questions";
tailf:cli-suppress-mode;
key question;
leaf question {
tailf:info "Device question, regular expression";
type string {
tailf:info "WORD;;Question, regex format";
}
}
leaf answer {
tailf:info "Answer to device question";
type string {
tailf:info "WORD;;Answer to device question | <exit|prompt|timeout|ignore|enter>";
}
}
}
so shouldn't the input be entered something like this:
auto_prompts.create('.Enter new key.')
auto_prompts['.Enter new key.'].answer = 'mykey12345'
-----8><-----
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide