]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
docker: Refactor to use new pluginlib.
authorRadosław Korzeniewski <radekk@inteos.pl>
Wed, 23 Dec 2020 16:51:00 +0000 (17:51 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:00 +0000 (09:03 +0100)
bacula/src/plugins/fd/docker/docker-fd.c
bacula/src/plugins/fd/docker/docker-fd.h

index 911b020bb7f0301fe4c82e3b015e16c39bc4b943..c762faf45f232db4ce9ed8cfd98df93a8f450deb 100644 (file)
@@ -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;
index c151d03ac439d48f8b0f5983062541452c63da84..35542ab71152f3f2375b1bd6d484dc1fce149363 100644 (file)
@@ -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"