X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Fbackend%2Fpuppet%2Fstore-configs.c;h=5506b0a939e984254f2c8646a7ba954a130dbc77;hp=e109b305819cfcec5fb1d7f32403241ed519d69b;hb=fffcdc97635e9fb40342c6ad55904cdc0b1ef101;hpb=851c33e513e67986fa3efa68400564b457d69d17 diff --git a/src/backend/puppet/store-configs.c b/src/backend/puppet/store-configs.c index e109b30..5506b0a 100644 --- a/src/backend/puppet/store-configs.c +++ b/src/backend/puppet/store-configs.c @@ -343,6 +343,9 @@ sdb_puppet_stcfg_config(oconfig_item_t *ci) { int i; + if (! ci) /* nothing to do to deconfigure this plugin */ + return 0; + for (i = 0; i < ci->children_num; ++i) { oconfig_item_t *child = ci->children + i; @@ -367,7 +370,8 @@ sdb_module_init(sdb_plugin_info_t *info) sdb_plugin_set_info(info, SDB_PLUGIN_INFO_VERSION, SDB_VERSION); sdb_plugin_set_info(info, SDB_PLUGIN_INFO_PLUGIN_VERSION, SDB_VERSION); - if (dbi_initialize(/* driver dir = */ NULL) < 0) { + /* don't reinitialize dbi when reinitializing the plugin */ + if (info && (dbi_initialize(/* driver dir = */ NULL) < 0)) { sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: failed to " "initialize DBI; possibly you don't have any drivers " "installed.");