fix error in checking for mnt

This commit is contained in:
xuu 2017-11-13 09:01:27 -07:00
parent 5c538c72f8
commit a89781d3aa
No known key found for this signature in database
GPG key ID: 8B3B0604F164E04F

View file

@ -463,6 +463,7 @@ def test_policy(obj_type, name, mntner):
return "FAIL" return "FAIL"
lis = find(["mnt-by"], {"@type": obj_type, "@name": name}) lis = find(["mnt-by"], {"@type": obj_type, "@name": name})
log.debug(lis)
if len(lis) == 0: if len(lis) == 0:
log.notice("%s does not currently exist" %(name)) log.notice("%s does not currently exist" %(name))
@ -471,11 +472,13 @@ def test_policy(obj_type, name, mntner):
status = 'FAIL' status = 'FAIL'
for o in lis: for o in lis:
for n in o: for n in o:
log.debug(n)
log.debug(mntner)
if n[0] == "mnt-by" and n[1] == mntner: if n[0] == "mnt-by" and n[1] == mntner:
status = 'PASS' status = 'PASS'
log.error("%s does not have mnt for object" %(mntner))
return status return status
log.error("%s does not have mnt for object" %(mntner))
return status return status
elif args["type"] in ["inetnum","inet6num"]: elif args["type"] in ["inetnum","inet6num"]: