Esempio n. 1
0
 def __init__(self,
              root,
              buckets=spawn.BUCKETS,
              max_per_bucket=spawn.MAX_PER_BUCKET):
     self.buckets = buckets
     self.paths = spawn.SpawnPaths(root, buckets)
     self.max_per_bucket = max_per_bucket
Esempio n. 2
0
    def __init__(self, root, buckets=spawn.BUCKETS):
        self.paths = spawn.SpawnPaths(root, buckets)
        fs.mkdir_safe(self.paths.manifest_dir)
        os.chmod(self.paths.manifest_dir, 0o1777)

        tmp_path = os.path.join(self.paths.manifest_dir, '.tmp')
        fs.mkdir_safe(tmp_path)
        os.chmod(tmp_path, 0o1777)
Esempio n. 3
0
    def test_get_instance_path_with_dot(self):
        """Tests that getting the instance path works correctly with a '.'."""
        paths = spawn.SpawnPaths('/does/not/exist', 1)
        job, bucket, running = utils.get_instance_path('test.dot.yml', paths)
        self.assertEqual(job, '/does/not/exist/apps/jobs/test.dot')
        self.assertEqual(bucket, '/does/not/exist/running/000000')
        self.assertEqual(running, '/does/not/exist/running/000000/test.dot')

        job, bucket, running = utils.get_instance_path('test.dot', paths)
        self.assertEqual(job, '/does/not/exist/apps/jobs/test.dot')
        self.assertEqual(bucket, '/does/not/exist/running/000000')
        self.assertEqual(running, '/does/not/exist/running/000000/test.dot')
Esempio n. 4
0
 def __init__(self, root, buckets=spawn.BUCKETS):
     self.paths = spawn.SpawnPaths(root, buckets)
     fs.mkdir_safe(self.paths.cleanup_dir)
Esempio n. 5
0
 def __init__(self, root, buckets=spawn.BUCKETS):
     self.paths = spawn.SpawnPaths(root, buckets)
     fs.mkdir_safe(self.paths.manifest_dir)
     os.chmod(self.paths.manifest_dir, 0o1777)