Add ova as valid name in addition to default_ova
This commit is contained in:
		@@ -168,14 +168,16 @@ def delete_ova(zkhandler, name):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
@ZKConnection(config)
 | 
					@ZKConnection(config)
 | 
				
			||||||
def upload_ova(zkhandler, pool, name, ova_size):
 | 
					def upload_ova(zkhandler, pool, name, ova_size):
 | 
				
			||||||
    # Check that we have a default_ova provisioning script
 | 
					    # Check that we have an ova or default_ova provisioning script
 | 
				
			||||||
    _, retcode = provisioner.list_script("default_ova", is_fuzzy=False)
 | 
					    _, retcode = provisioner.list_script("ova", is_fuzzy=False)
 | 
				
			||||||
    if retcode != 200:
 | 
					    if retcode != 200:
 | 
				
			||||||
        output = {
 | 
					        _, retcode = provisioner.list_script("default_ova", is_fuzzy=False)
 | 
				
			||||||
            "message": "Did not find a 'default_ova' provisioning script. Please add one with that name, either the example from '/usr/share/pvc/provisioner/examples/script/2-ova.py' or a custom one, before uploading OVAs."
 | 
					        if retcode != 200:
 | 
				
			||||||
        }
 | 
					            output = {
 | 
				
			||||||
        retcode = 400
 | 
					                "message": "Did not find a 'default_ova' provisioning script. Please add one with that name, either the example from '/usr/share/pvc/provisioner/examples/script/2-ova.py' or a custom one, before uploading OVAs."
 | 
				
			||||||
        return output, retcode
 | 
					            }
 | 
				
			||||||
 | 
					            retcode = 400
 | 
				
			||||||
 | 
					            return output, retcode
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ova_archive = None
 | 
					    ova_archive = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user