Conversation
b101bf4 to
bec425b
Compare
| } | ||
|
|
||
| if (lyd_parse_data_path(ctx, config_file, LYD_XML, LYD_PARSE_ONLY | LYD_PARSE_OPAQ, 0, &config)) { | ||
| if (lyd_parse_data_path(ctx, config_file, LYD_XML, LYD_PARSE_ONLY, 0, &config)) { |
There was a problem hiding this comment.
Data can be validated now, so remove LYD_PARSE_ONLY and add the validation flag LYD_PARSE_PRESENT. So when you know the data are valid, some later checks can be skipped.
| /* <netconf-client> -> <searchpath> */ | ||
| opts.config_editor = strdup(lyd_get_value(match)); | ||
| } | ||
| match = NULL; |
There was a problem hiding this comment.
Redundant, it does not have to be initialized for lyd_find_path(), at other places, too.
| lyd_find_path(auth_pref, "knownhost-mode", 0, &match); | ||
| if (match) { | ||
| mode = lyd_get_value(match); | ||
| if (!strcmp(mode, "accept")) { |
There was a problem hiding this comment.
Seems like a good opportunity for a str2knownhosts_mode() function.
|
|
||
| /* knownhost-mode */ | ||
| if (opts.knownhosts_mode) { | ||
| if (opts.knownhosts_mode == NC_SSH_KNOWNHOSTS_ACCEPT) { |
There was a problem hiding this comment.
Similarly, reverse function knownhosts_mode2str() should be used.
| module netopeer2-cli { | ||
| yang-version 1.1; | ||
| namespace "urn:cesnet:netopeer2:cli"; | ||
| prefix "cli"; |
There was a problem hiding this comment.
Add common module metadata similarly to netopeer-notifications such as yang-version, organization, contact, or revision.
| leaf knownhost-mode { | ||
| type string; | ||
| description | ||
| "Specifies the mode for handling known host keys. |
There was a problem hiding this comment.
Mention what is the behavior in case the leaf does not exist at all.
| } | ||
| } | ||
| } | ||
| } No newline at end of file |
bec425b to
da25e32
Compare
No description provided.