Bug 912242 - tailing spaces in distro tree url should be removed
Summary: tailing spaces in distro tree url should be removed
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Community
Component: inventory
Version: 0.11
Hardware: Unspecified
OS: Unspecified
low
low vote
Target Milestone: 0.12
Assignee: Qixiang Wan
QA Contact: Dan Callaghan
URL:
Whiteboard: UX
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-18 08:14 UTC by Qixiang Wan
Modified: 2018-02-06 00:41 UTC (History)
6 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2013-04-11 04:56:26 UTC


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.