mirror of
				https://git.dn42.dev/dn42/registry.git
				synced 2025-10-31 03:30:49 +08:00 
			
		
		
		
	format policy output
This commit is contained in:
		
							parent
							
								
									34b85e24a2
								
							
						
					
					
						commit
						c9a1171834
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		|  | @ -530,7 +530,7 @@ def test_policy(obj_type, name, mntner): | |||
|         if select == None: | ||||
|             pass | ||||
| 
 | ||||
|         elif policy[select].get("policy","closed") == "open": | ||||
|         elif policy.get(select,{}).get("policy","closed") == "open": | ||||
|             log.notice("Policy is open for parent object") | ||||
|             return "PASS" | ||||
| 
 | ||||
|  | @ -588,7 +588,7 @@ def test_policy(obj_type, name, mntner): | |||
|         if select == None: | ||||
|             pass | ||||
| 
 | ||||
|         elif policy[select].get("policy","closed") == "open": | ||||
|         elif policy.get(select,{}).get("policy","closed") == "open": | ||||
|             log.notice("Policy is open for parent object") | ||||
|             return "PASS" | ||||
| 
 | ||||
|  | @ -642,7 +642,7 @@ def test_policy(obj_type, name, mntner): | |||
|             elif select[0]<=k[0] or select[1]>=k[1]: | ||||
|                 select = k | ||||
| 
 | ||||
|         if policy[select].get("policy","closed") == "open": | ||||
|         if policy.get(select,{}).get("policy","closed") == "open": | ||||
|             log.notice("Policy is open for parent object") | ||||
|             return "PASS" | ||||
| 
 | ||||
|  | @ -846,7 +846,7 @@ if __name__ == '__main__': | |||
| 
 | ||||
|         status = test_policy(args["type"], args["name"], args["mntner"]) | ||||
| 
 | ||||
|         print("POLICY %12s\t%12s\t%20s\t%s" %(args["mntner"], args["type"], args["name"], status)) | ||||
|         print("POLICY %-12s\t%-8s\t%20s\t%s" %(args["mntner"], args["type"], args["name"], status)) | ||||
|         if status != "PASS": | ||||
|             sys.exit(1) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 xuu
						xuu