34#include "cmdhandler.h"
40#include "clientpipe.h"
43#include "longgetopt.h"
51static const char *module_str =
"update_repositorylist_cmd";
55validate_configfile(
const char* cfgfile)
57 char *kasp = NULL, *zonelist = NULL, **replist = NULL;
59 int cc_status =
check_conf(cfgfile, &kasp, &zonelist, &replist,
63 if (replist)
for (i = 0; i < repcount; i++) free(replist[i]);
75perform_update_repositorylist(
int sockfd,
engine_type* engine)
77 const char* cfgfile = ODS_SE_CFGFILE;
79 hsm_repository_t* new_reps;
81 if (validate_configfile(cfgfile)) {
82 ods_log_error_and_printf(sockfd, module_str,
83 "Unable to validate '%s' consistency.", cfgfile);
97 client_printf(sockfd,
"Could not load new repositories. Will continue with old.\n");
103 client_printf(sockfd,
"new repositories parsed successful.\n");
104 client_printf(sockfd,
"Notifying enforcer of new respositories.\n");
116 client_printf(sockfd,
117 "update repositorylist\n");
123 client_printf(sockfd,
124 "Import respositories from conf.xml into the enforcer.\n\n");
128run(cmdhandler_ctx_type* context,
int argc,
char* argv[])
130 int sockfd = context->sockfd;
133 if (!perform_update_repositorylist(sockfd, engine)) {
134 ods_log_error_and_printf(sockfd, module_str,
135 "unable to update repositorylist.");
142 "update repositorylist", &usage, &help, NULL, NULL, &run, NULL
engine_type * getglobalcontext(cmdhandler_ctx_type *context)
void engine_start_workers(engine_type *engine)
void engine_stop_workers(engine_type *engine)
int check_conf(const char *conf, char **kasp, char **zonelist, char ***repo_listout, int *repo_countout, int verbose)
hsm_repository_t * parse_conf_repositories(const char *cfgfile)
pthread_mutex_t signal_lock
pthread_cond_t signal_cond
engineconfig_type * config
hsm_repository_t * repositories
struct cmd_func_block update_repositorylist_funcblock