summaryrefslogtreecommitdiff
path: root/mgmtd/mgmt_vty.c
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2023-05-09 09:19:24 -0400
committerChristian Hopps <chopps@labn.net>2023-05-30 02:09:44 -0400
commita1d8c7a36e44b5b5e87f9f863d04a74670a19843 (patch)
treeefad6c38f896d10136459df47e1a615b18eabc29 /mgmtd/mgmt_vty.c
parentedafa64c3027755ca0e08e0e5a6ffbb6c91416f7 (diff)
mgmtd: fix reading of config file[s]
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'mgmtd/mgmt_vty.c')
-rw-r--r--mgmtd/mgmt_vty.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/mgmtd/mgmt_vty.c b/mgmtd/mgmt_vty.c
index 7d6c8f206c..5cb172f3c9 100644
--- a/mgmtd/mgmt_vty.c
+++ b/mgmtd/mgmt_vty.c
@@ -10,6 +10,7 @@
#include "command.h"
#include "json.h"
+#include "network.h"
#include "northbound_cli.h"
#include "mgmtd/mgmt.h"
@@ -20,6 +21,8 @@
#include "mgmtd/mgmt_vty_clippy.c"
+extern struct frr_daemon_info *mgmt_daemon_info;
+
DEFPY(show_mgmt_be_adapter,
show_mgmt_be_adapter_cmd,
"show mgmt backend-adapter all",
@@ -452,6 +455,16 @@ DEFPY(debug_mgmt, debug_mgmt_cmd,
}
/*
+ * We need an event driven file reader for reading in config files.
+ */
+
+static void mgmt_config_read_in(struct event *event)
+{
+ mgmt_vty_read_configs();
+}
+
+#if 0
+/*
* Analog of `frr_config_read_in()`, instead of our config file though we loop
* over all daemons that have transitioned to mgmtd, loading their configs
*/
@@ -477,6 +490,7 @@ static int mgmt_config_pre_hook(struct event_loop *loop)
}
return 0;
}
+#endif
void mgmt_vty_init(void)
{
@@ -491,7 +505,10 @@ void mgmt_vty_init(void)
static_vty_init();
#endif
- hook_register(frr_config_pre, mgmt_config_pre_hook);
+ // hook_register(frr_config_pre, mgmt_config_pre_hook);
+
+ event_add_event(mm->master, mgmt_config_read_in, NULL, 0,
+ &mgmt_daemon_info->read_in);
install_node(&debug_node);