Bug 912242

Summary: tailing spaces in distro tree url should be removed
Product: [Retired] Beaker Reporter: Qixiang Wan <qwan>
Component: inventoryAssignee: Qixiang Wan <qwan>
Status: CLOSED CURRENTRELEASE QA Contact: Dan Callaghan <dcallagh>
Severity: low Docs Contact:
Priority: low    
Version: 0.11CC: asaha, dcallagh, llim, qwan, rglasz, rmancy
Target Milestone: 0.12   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: UX
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-11 04:56:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Qixiang Wan 2013-02-18 08:14:49 UTC
Description of problem:
User may copy paste distro tree urls which have tailing spaces while adding new distro tree urls via web UI, this can cause failures due to wrong urls are generated for the kernel and ramdisk images.   

Version-Release number of selected component (if applicable):
0.11

How reproducible:
100%

Steps to Reproduce:
1. Navigate to http://your-beaker-server/distrotrees/<id>
2. Add a new url which contains tailing spaces for one of the lab controllers
and remove other valid urls for this lab controller.
3. Create a job with the distro on a system which is controlled by that lab controller
  
Actual results:
wrong urls generated for the kernel and ramdisk images while using that distro tree.

Expected results:
the tailing spaces should be removed

Additional info:

Comment 1 Qixiang Wan 2013-02-18 08:45:32 UTC
correction to the original report:
Actually it only happens while using RHEV dynamic guests, so the reproduce steps should be:

1. Add a nfs tree url which has tailing spaces to one of the lab controllers
2. Create a job which can run on RHEV dynamic guests (with the lab controller updated in step 1).

It was caused by model.py -> VirtManager -> start_install:

kernel_path = os.path.join(local_path, kernel.path)
initrd_path = os.path.join(local_path, initrd.path)

os.path.join doesn't strip the tailing spaces in 'local_path', thus the vm booted up with invalid local images, and user don't know what happens until check the vdsm on RHEV hypervisor host.

Comment 2 Qixiang Wan 2013-02-18 09:17:55 UTC
And if the distro url is not ending with '/', there is problem too. The invalid image urls could be:

1. '/net/tree.server.com/released/rhel/rhel6/U4/i386/os/ pxeboot/images/vmlinuz'
2. '/net/tree.server.com/released/rhel/rhel6/U4/i386/ospxeboot/images/vmlinuz'

Comment 4 Qixiang Wan 2013-02-21 01:53:10 UTC
http://gerrit.beaker-project.org/#/c/1735/

Comment 6 Dan Callaghan 2013-04-03 06:42:29 UTC
Verified that distro tree URLs are correctly normalized to strip trailing whitespace and append a / when adding them on the Distro Tree page.

Comment 7 Dan Callaghan 2013-04-11 04:56:26 UTC
Beaker 0.12 has been released.