Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[WIP] Add debug info#2 to template uploader #10128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 25 additions & 13 deletions cfme/utils/template/rhevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,25 @@ def add_glance_to_provider(self):
@log_wrap("import template from Glance server")
def import_template_from_glance(self):
"""Import the template from glance to local rhevm datastore, sucks."""
self.mgmt.import_glance_image(
source_storage_domain_name=self.glance_key,
target_cluster_name=self.provider_data.template_upload.cluster,
source_template_name=self.image_name,
target_template_name=self.temp_template_name,
target_storage_domain_name=self.provider_data.template_upload.storage_domain)
mgmt_network = self.provider_data.template_upload.get('management_network')
rv_tmpl = self.mgmt.get_template(self.temp_template_name)
if self.stream == 'upstream':
self.mgmt.import_glance_image(
source_storage_domain_name=self.glance_key,
target_cluster_name=self.provider_data.template_upload.cluster,
source_template_name=self.image_name,
target_template_name=self.template_name,
target_storage_domain_name=self.provider_data.template_upload.storage_domain)
mgmt_network = self.provider_data.template_upload.get('management_network')
rv_tmpl = self.mgmt.get_template(self.template_name)

else:
self.mgmt.import_glance_image(
source_storage_domain_name=self.glance_key,
target_cluster_name=self.provider_data.template_upload.cluster,
source_template_name=self.image_name,
target_template_name=self.temp_template_name,
target_storage_domain_name=self.provider_data.template_upload.storage_domain)
mgmt_network = self.provider_data.template_upload.get('management_network')
rv_tmpl = self.mgmt.get_template(self.temp_template_name)
if mgmt_network:
# network devices, qcow template doesn't have any
temp_nics = rv_tmpl.get_nics()
Expand Down Expand Up @@ -127,11 +138,12 @@ def run(self):
self.glance_upload()
self.add_glance_to_provider()
self.import_template_from_glance()
self.deploy_vm_from_template()
if self.stream == 'upstream':
self.manageiq_cleanup()
self.add_disk_to_vm()
self.templatize_vm()
if self.stream == 'downstream':
self.deploy_vm_from_template()
# if self.stream == 'upstream':
# self.manageiq_cleanup()
self.add_disk_to_vm()
self.templatize_vm()
return True
except Exception:
logger.exception('template creation failed for provider {}'.format(
Expand Down