mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-11 09:59:19 -04:00
SortBySpec: avoid triggering bandit security checker
Guess it was triggered due to naming the variable "token", maybe "sort_key" is less problematic.
This commit is contained in:
parent
9a469e32cf
commit
27561bd9cc
1 changed files with 3 additions and 3 deletions
|
|
@ -351,9 +351,9 @@ def FilesystemPathSpec(text):
|
|||
def SortBySpec(text):
|
||||
from ..manifest import AI_HUMAN_SORT_KEYS
|
||||
|
||||
for token in text.split(","):
|
||||
if token not in AI_HUMAN_SORT_KEYS and token != "ts": # idempotency: do not reject ts
|
||||
raise argparse.ArgumentTypeError("Invalid sort key: %s" % token)
|
||||
for sort_key in text.split(","):
|
||||
if sort_key not in AI_HUMAN_SORT_KEYS and sort_key != "ts": # idempotency: do not reject ts
|
||||
raise argparse.ArgumentTypeError("Invalid sort key: %s" % sort_key)
|
||||
return text.replace("timestamp", "ts").replace("archive", "name")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue