libvirt-check-trim: fail more elegantly if listAllDomains() is not available
This commit is contained in:
		
							parent
							
								
									ccd71f9bad
								
							
						
					
					
						commit
						c0aebcbe91
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -13,6 +13,10 @@ if not conn: | ||||||
|     print('Failed to open connection to the hypervisor!') |     print('Failed to open connection to the hypervisor!') | ||||||
|     sys.exit(1) |     sys.exit(1) | ||||||
| 
 | 
 | ||||||
|  | if not hasattr(conn, "listAllDomains"): | ||||||
|  |     print('connection does not have listAllDomains(), is python-libvirt too old?') | ||||||
|  |     sys.exit(1) | ||||||
|  | 
 | ||||||
| for domain in conn.listAllDomains(): | for domain in conn.listAllDomains(): | ||||||
|     print('== {}'.format(domain.name())) |     print('== {}'.format(domain.name())) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue