Exemplo n.º 1
0
 def run(self):
     if self.command.package_uuid:
         workdir = os.path.join(get_packages_dir(), self.command.package_uuid)
     else:
         workdir = get_packages_dir()
     output, exitcode = launcher(self.command.start_file, self.command.params, workdir)
     return (output, exitcode)
Exemplo n.º 2
0
 def run(self):
     path = self.command.dlp_client.get_package(self.command.package_uuid,
                                                workdir=get_packages_dir())
     if path:
         return ("%f O: Package downloaded at %s" % (time.time(), path), 0)
     else:
         return ("%f E: Failed to download package" % time.time(), 1)
Exemplo n.º 3
0
 def run(self):
     package_dir = os.path.join(get_packages_dir(), self.command.package_uuid)
     if os.path.exists(package_dir):
         shutil.rmtree(package_dir)
     if os.path.exists(package_dir + ".zip"):
         os.unlink(package_dir + ".zip")
     return ("%f O: Package files removed" % time.time(), 0)
Exemplo n.º 4
0
 def run(self):
     if self.command.package_uuid:
         package_dir = os.path.join(get_packages_dir(), self.command.package_uuid)
         if os.path.exists(package_dir):
             shutil.rmtree(package_dir)
         if os.path.exists(package_dir + ".zip"):
             os.unlink(package_dir + ".zip")
     return ("%f O: Package files removed" % time.time(), 0)