fix "all" issue on pushing
This commit is contained in:
parent
192dd66aaf
commit
61369085f3
16
admin
16
admin
|
@ -39,15 +39,13 @@ def construct_predicate(id_list, group_list):
|
|||
def construct_predicate_for_pushing(id_list, group_list, own_keys):
|
||||
def predicate(id, group):
|
||||
with open(workdir/Path(id)) as keylist:
|
||||
# maybe make it into a set?
|
||||
for key in keylist:
|
||||
if key in own_keys:
|
||||
return ((id in id_list) or
|
||||
set(groups).intersection(group_list))
|
||||
else:
|
||||
# no 'break' means no pub keys in file
|
||||
print(f"None of the local public keys are in the keyfile for {id}")
|
||||
return False
|
||||
if any(key in own_keys for key in keylist):
|
||||
return ("all" in (group_list+id_list) or
|
||||
(id in id_list) or
|
||||
set(groups).intersection(group_list)):
|
||||
|
||||
print(f"None of the local public keys are in the keyfile for {id}")
|
||||
return False
|
||||
return predicate
|
||||
|
||||
def execute(operation, predicate):
|
||||
|
|
Loading…
Reference in New Issue