Exemplo n.º 1
0
 def handle_event(self, event):
     CfgVerifier.handle_event(self, event)
     if not self.data:
         return
     self.cmd = []
     if not os.access(self.name, os.X_OK):
         bangpath = self.data.splitlines()[0].strip()
         if bangpath.startswith("#!"):
             self.cmd.extend(shlex.split(bangpath[2:].strip()))
         else:
             raise PluginExecutionError("Cannot execute %s" % self.name)
     self.cmd.append(self.name)
Exemplo n.º 2
0
 def handle_event(self, event):
     CfgVerifier.handle_event(self, event)
     if not self.data:
         return
     self.cmd = []
     if not os.access(self.name, os.X_OK):
         bangpath = self.data.splitlines()[0].strip()
         if bangpath.startswith("#!"):
             self.cmd.extend(shlex.split(bangpath[2:].strip()))
         else:
             raise PluginExecutionError("Cannot execute %s" % self.name)
     self.cmd.append(self.name)
 def handle_event(self, event):
     CfgVerifier.handle_event(self, event)
     if not self.data:
         return
     self.cmd = []
     if not os.access(self.name, os.X_OK):
         bangpath = self.data.splitlines()[0].strip()
         if bangpath.startswith("#!"):
             self.cmd.extend(shlex.split(bangpath[2:].strip()))
         else:
             msg = "%s: Cannot execute %s" % (self.__class__.__name__,
                                              self.name)
             LOGGER.error(msg)
             raise Bcfg2.Server.Plugin.PluginExecutionError(msg)
     self.cmd.append(self.name)