Beispiel #1
0
    def exists(self):
        """
        Returns ``True`` if the path for this FileTarget exists; ``False`` otherwise.

        This method is implemented by using :py:attr:`fs`.
        """
        path = self.path
        original_path = path
        while "*" in path or "?" in path or "[" in path or "{" in path:
            path = os.path.dirname(path)

        if path != original_path:
            logger.info("Wildcard in path '%s', checking only for '%s'",
                        original_path, path)
            # treat it as directory (can have different behaviour on key-values stores like s3)
            if not path.endswith(os.path.sep):
                path += os.path.sep
        return self.fs.exists(path)
Beispiel #2
0
 def mark_success(self):
     if not self.exists():
         logger.info(
             "Target is not exists, it can not be marked as success")