Move some messages around

This commit is contained in:
Joshua Boniface 2020-05-05 16:19:18 -04:00
parent 34c4690d49
commit b91923735c
1 changed files with 4 additions and 3 deletions

View File

@ -1439,6 +1439,8 @@ def create_vm(self, vm_name, vm_profile, define_vm=True, start_vm=True):
src_volume_name = volume['volume_name'] src_volume_name = volume['volume_name']
src_volume = "{}/{}".format(volume['pool'], src_volume_name) src_volume = "{}/{}".format(volume['pool'], src_volume_name)
print('Converting {} source volume {} to raw format on {}'.format(volume['volume_format'], src_volume, dst_volume))
# Map the target RBD device # Map the target RBD device
retcode, retmsg = pvc_ceph.map_volume(zk_conn, volume['pool'], dst_volume_name) retcode, retmsg = pvc_ceph.map_volume(zk_conn, volume['pool'], dst_volume_name)
if not retcode: if not retcode:
@ -1466,7 +1468,6 @@ def create_vm(self, vm_name, vm_profile, define_vm=True, start_vm=True):
retcode, retmsg = pvc_ceph.unmap_volume(zk_conn, volume['pool'], dst_volume_name) retcode, retmsg = pvc_ceph.unmap_volume(zk_conn, volume['pool'], dst_volume_name)
if not retcode: if not retcode:
raise ProvisioningError('Failed to unmap destination volume "{}": {}'.format(dst_volume_name, retmsg)) raise ProvisioningError('Failed to unmap destination volume "{}": {}'.format(dst_volume_name, retmsg))
print('Converted {} source volume {} to raw format on {}'.format(volume['volume_format'], src_volume, dst_volume))
else: else:
if volume.get('source_volume') is not None: if volume.get('source_volume') is not None:
continue continue
@ -1474,6 +1475,8 @@ def create_vm(self, vm_name, vm_profile, define_vm=True, start_vm=True):
if volume.get('filesystem') is None: if volume.get('filesystem') is None:
continue continue
print("Creating {} filesystem on {}:\n{}".format(volume['filesystem'], dst_volume, stdout))
filesystem_args_list = list() filesystem_args_list = list()
for arg in volume['filesystem_args'].split(): for arg in volume['filesystem_args'].split():
arg_entry, arg_data = arg.split('=') arg_entry, arg_data = arg.split('=')
@ -1496,8 +1499,6 @@ def create_vm(self, vm_name, vm_profile, define_vm=True, start_vm=True):
if retcode: if retcode:
raise ProvisioningError('Failed to create {} filesystem on "{}": {}'.format(volume['filesystem'], dst_volume, stderr)) raise ProvisioningError('Failed to create {} filesystem on "{}": {}'.format(volume['filesystem'], dst_volume, stderr))
print("Created {} filesystem on {}:\n{}".format(volume['filesystem'], dst_volume, stdout))
if is_script_install: if is_script_install:
# Create temporary directory # Create temporary directory
retcode, stdout, stderr = pvc_common.run_os_command("mktemp -d") retcode, stdout, stderr = pvc_common.run_os_command("mktemp -d")