diff --git a/vmtp/compute.py b/vmtp/compute.py index 70d4a06..dad6bd7 100644 --- a/vmtp/compute.py +++ b/vmtp/compute.py @@ -361,7 +361,7 @@ class Compute(object): else: for host in host_list: # this host must be a compute node - if host.binary != 'nova-compute' or host.state != 'up': + if host.binary != 'nova-compute' or host.state != 'up' or host.status != 'enabled': continue candidate = None if self.config.availability_zone: diff --git a/vmtp/vmtp.py b/vmtp/vmtp.py index fb11855..fc7d487 100755 --- a/vmtp/vmtp.py +++ b/vmtp/vmtp.py @@ -220,10 +220,15 @@ class VmtpTest(object): if self.config.vm_image_url != "": LOG.info('%s: image for VM not found, trying to upload it ...', self.config.image_name) - self.comp.upload_image_via_url( + flag = self.comp.upload_image_via_url( self.glance_client, self.config.image_name, self.config.vm_image_url) + if not flag: + # Exit the pogram + LOG.error('Cannot upload image %s to the cloud. ABORTING.', + self.config.image_name) + sys.exit(1) self.image_instance = self.comp.find_image(self.glance_client, self.config.image_name) self.image_uploaded = True