From: Radosław Korzeniewski Date: Wed, 23 Dec 2020 16:51:00 +0000 (+0100) Subject: docker: Refactor to use new pluginlib. X-Git-Tag: Release-11.3.2~729 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d0a89775375dafb594192add1b31eee5a8d10ac;p=thirdparty%2Fbacula.git docker: Refactor to use new pluginlib. --- diff --git a/bacula/src/plugins/fd/docker/docker-fd.c b/bacula/src/plugins/fd/docker/docker-fd.c index 911b020bb..c762faf45 100644 --- a/bacula/src/plugins/fd/docker/docker-fd.c +++ b/bacula/src/plugins/fd/docker/docker-fd.c @@ -106,20 +106,12 @@ bRC DLL_IMP_EXP loadPlugin(bInfo *lbinfo, bFuncs *lbfuncs, pInfo ** pinfo, pFunc bfuncs = lbfuncs; /* set Bacula function pointers */ binfo = lbinfo; - Dmsg2(DINFO, PLUGINNAME " Plugin version %s %s (c) 2019 by Inteos\n", - DOCKER_VERSION, DOCKER_DATE); + Dmsg3(DINFO, "%s Plugin version %s %s (c) 2020 by Inteos\n", + PLUGINNAME, DOCKER_VERSION, DOCKER_DATE); *pinfo = &pluginInfo; /* return pointer to our info */ *pfuncs = &pluginFuncs; /* return pointer to our functions */ - if (access(DOCKER_CMD, X_OK) < 0){ - berrno be; - bfuncs->DebugMessage(NULL, __FILE__, __LINE__, DERROR, - PLUGINPREFIX " Unable to use command tool: %s Err=%s\n", DOCKER_CMD, - be.bstrerror()); - return bRC_Error; - } - return bRC_OK; } @@ -621,10 +613,11 @@ bRC DOCKER::handlePluginEvent(bpContext *ctx, bEvent *event, void *value) case bEventHandleBackupFile: if (isourplugincommand(PLUGINPREFIX, (char*)value)){ DMSG0(ctx, DERROR, "Invalid handle Option Plugin called!\n"); - JMSG0(ctx, M_FATAL, - "The " PLUGINNAME " plugin doesn't support the Option Plugin configuration.\n" - "Please review your FileSet and move the Plugin=" PLUGINPREFIX - "... command into the Include {} block.\n"); + JMSG2(ctx, M_FATAL, + "The %s plugin doesn't support the Option Plugin configuration.\n" + "Please review your FileSet and move the Plugin=%s" + "... command into the Include {} block.\n", + PLUGINNAME, PLUGINPREFIX); return bRC_Error; } break; diff --git a/bacula/src/plugins/fd/docker/docker-fd.h b/bacula/src/plugins/fd/docker/docker-fd.h index c151d03ac..35542ab71 100644 --- a/bacula/src/plugins/fd/docker/docker-fd.h +++ b/bacula/src/plugins/fd/docker/docker-fd.h @@ -37,8 +37,8 @@ #define DOCKER_DESCRIPTION "Bacula Docker Plugin" /* Plugin compile time variables */ -#define PLUGINPREFIX "docker:" -#define PLUGINNAME "Docker" +const char *PLUGINPREFIX = "docker:"; +const char *PLUGINNAME = "Docker"; #define PLUGINNAMESPACE "/@docker" #define CONTAINERNAMESPACE "/container" #define IMAGENAMESPACE "/image"