mirror of
https://git.dn42.dev/dn42/registry.git
synced 2025-05-06 12:45:21 +08:00
fix error in checking for mnt
This commit is contained in:
parent
e51bae8623
commit
b1f9be9f77
1 changed files with 4 additions and 1 deletions
|
@ -463,6 +463,7 @@ def test_policy(obj_type, name, mntner):
|
|||
return "FAIL"
|
||||
|
||||
lis = find(["mnt-by"], {"@type": obj_type, "@name": name})
|
||||
log.debug(lis)
|
||||
|
||||
if len(lis) == 0:
|
||||
log.notice("%s does not currently exist" %(name))
|
||||
|
@ -471,11 +472,13 @@ def test_policy(obj_type, name, mntner):
|
|||
status = 'FAIL'
|
||||
for o in lis:
|
||||
for n in o:
|
||||
log.debug(n)
|
||||
log.debug(mntner)
|
||||
if n[0] == "mnt-by" and n[1] == mntner:
|
||||
status = 'PASS'
|
||||
log.error("%s does not have mnt for object" %(mntner))
|
||||
return status
|
||||
|
||||
log.error("%s does not have mnt for object" %(mntner))
|
||||
return status
|
||||
|
||||
elif args["type"] in ["inetnum","inet6num"]:
|
||||
|
|
Loading…
Add table
Reference in a new issue