confd: refactor ietf-system augments and deviations

Initial yang model cleanup:

 - Use infix-foo@rev.yang for augments and deviations of each std-foo model
 - Drop kernelkit-infix-deviations, moved to infix-system model

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-06-20 11:11:52 +02:00
committed by Tobias Waldekranz
parent aa372c247e
commit 8462fe4ab6
6 changed files with 26 additions and 52 deletions
-4
View File
@@ -105,10 +105,6 @@ int sr_plugin_init_cb(sr_session_ctx_t *session, void **priv)
/* YOUR_INIT GOES HERE */
rc = srx_require_modules(confd.conn, core_reqs);
if (rc)
goto err;
return SR_ERR_OK;
err:
ERROR("init failed: %s", sr_strerror(rc));
+1 -2
View File
@@ -26,9 +26,8 @@ static const char *sysfeat[] = {
};
static const struct srx_module_requirement ietf_system_reqs[] = {
{ .dir = YANG_PATH_, .name = "ietf-system", .rev = "2014-08-06", .features = sysfeat },
{ .dir = YANG_PATH_, .name = "ietf-system", .rev = "2014-08-06", .features = sysfeat },
{ .dir = YANG_PATH_, .name = "infix-system", .rev = "2023-04-11" },
{ NULL }
};
-6
View File
@@ -21,10 +21,4 @@ int asprintf(char **strp, const char *fmt, ...);
#define ERROR(fmt, ...) syslog(LOG_ERR, "%s: " fmt, __func__, ##__VA_ARGS__)
#define ERRNO(fmt, ...) syslog(LOG_ERR, "%s: " fmt ": %s", __func__, ##__VA_ARGS__, strerror(errno))
static const struct srx_module_requirement core_reqs[] = {
{ .dir = YANG_PATH_, .name = "kernelkit-infix-deviations", .rev = "2023-04-03" },
{ NULL }
};
#endif /* CONFD_COMMON_H_ */
-6
View File
@@ -230,12 +230,6 @@ int sr_plugin_init_cb(sr_session_ctx_t *session, void **priv)
return err;
}
err = srx_require_modules(conn, core_reqs);
if (err) {
ERROR("Error requiring OP modules: %s", sr_strerror(err));
return err;
}
return SR_ERR_OK;
}
+25 -15
View File
@@ -1,20 +1,30 @@
module infix-system {
prefix "infix-sys";
yang-version 1.1;
namespace "urn:infix:params:xml:ns:yang:infix-system";
yang-version 1.1;
namespace "urn:infix:system:ns:yang:1.0";
prefix infix-sys;
import ietf-system {
prefix "sys";
}
import ietf-system {
prefix sys;
}
revision 2023-04-11 {
description "Initial revision.";
}
organization "KernelKit";
contact "kernelkit@googlegroups.com";
description "Infix augments and deviations to ietf-system.";
augment "/sys:system" {
leaf motd {
type string;
description "Set the MotD (Message of the Day), which is shown after login";
}
}
revision 2023-04-11 {
description "Initial revision.";
reference "internal";
}
augment "/sys:system" {
description "Augments to ietf-system not found in any other model.";
leaf motd {
type string;
description "Set the MotD (Message of the Day), shown after login";
}
}
deviation "/sys:system/sys:clock/sys:timezone/sys:timezone-utc-offset/sys:timezone-utc-offset" {
deviate not-supported;
}
}
@@ -1,19 +0,0 @@
module kernelkit-infix-deviations {
yang-version 1.1;
namespace "urn:kernelkit:params:xml:ns:yang:infix";
prefix "kkit";
import ietf-system {
prefix sys;
}
organization "KernelKit";
contact "kernelkit@googlegroups.com";
description "Infix deviations in standard yang models.";
revision "2023-04-03" {
description "Initial revision.";
}
deviation /sys:system/sys:clock/sys:timezone/sys:timezone-utc-offset/sys:timezone-utc-offset {
deviate not-supported;
}
}