Skip to content

Commit 9e39b04

Browse files
committed
allocate-torrents: limit to specific computers
1 parent b9692b7 commit 9e39b04

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/multidb/allocate_torrents.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def parse_args():
4242
)
4343
parser.add_argument("--up-limit", "--ul-limit", "--upload-limit", type=str, help="Upload limit")
4444

45+
parser.add_argument("--hosts", action=argparse_utils.ArgparseList, help="Limit to specific computers")
46+
4547
arggroups.debug(parser)
4648

4749
parser.add_argument("computer_database")
@@ -91,6 +93,8 @@ def allocate_torrents():
9193
},
9294
)
9395
)
96+
disks = [d for d in disks if d["host"] in args.hosts]
97+
9498
total_available = sum(d["free"] - args.min_free_space for d in disks)
9599
print(f"{len(disks)} disks matched. {strings.file_size(total_available)} available space")
96100

0 commit comments

Comments
 (0)