|
@@ -32,20 +32,6 @@ int kplugin_sysrepo_init(kcontext_t *context)
|
|
|
plugin = kcontext_plugin(context);
|
|
|
assert(plugin);
|
|
|
|
|
|
- err = sr_connect(SR_CONN_DEFAULT, &conn);
|
|
|
- if (err) {
|
|
|
- fprintf(stderr, "Can't connect to Sysrepo\n");
|
|
|
- return -1;;
|
|
|
- }
|
|
|
- err = sr_session_start(conn, SR_DS_RUNNING, &sess);
|
|
|
- if (err) {
|
|
|
- fprintf(stderr, "Can't start Sysrepo session\n");
|
|
|
- sr_disconnect(conn);
|
|
|
- return -1;
|
|
|
- }
|
|
|
-
|
|
|
- kplugin_set_udata(plugin, sess);
|
|
|
-
|
|
|
// Symbols
|
|
|
kplugin_add_syms(plugin, ksym_new("srp_compl", srp_compl));
|
|
|
|
|
@@ -55,16 +41,7 @@ int kplugin_sysrepo_init(kcontext_t *context)
|
|
|
|
|
|
int kplugin_sysrepo_fini(kcontext_t *context)
|
|
|
{
|
|
|
- kplugin_t *plugin = NULL;
|
|
|
- sr_session_ctx_t *sess = NULL;
|
|
|
-
|
|
|
- if (!context)
|
|
|
- return -1;
|
|
|
-
|
|
|
- plugin = kcontext_plugin(context);
|
|
|
- sess = (sr_session_ctx_t *)kplugin_udata(plugin);
|
|
|
-
|
|
|
- sr_disconnect(sr_session_get_connection(sess));
|
|
|
+ context = context; // Happy compiler
|
|
|
|
|
|
return 0;
|
|
|
}
|