Bug 1436634 - Kickstart "Default Download Location" is appended verbatim, not translated.
Summary: Kickstart "Default Download Location" is appended verbatim, not translated.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 2.6
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
Assignee: Jiří Dostál
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space27
TreeView+ depends on / blocked
 
Reported: 2017-03-28 11:04 UTC by Laurence Rochfort
Modified: 2017-09-27 19:33 UTC (History)
4 users (show)

Fixed In Version: spacewalk-java-2.7.69-1
Clone Of:
Environment:
Last Closed: 2017-09-27 19:33:42 UTC
Embargoed:


Attachments (Terms of Use)

Description Laurence Rochfort 2017-03-28 11:04:09 UTC
Description of problem:
When creating a kickstart via the wizard, if "Default Download Location" is selected the path of the distro tree is appended to the Kickstart --url in the kickstart file, rather than being translated into a /ks/cfg type cobbler path.

The is also occurs if manually entering the distro-tree path into the url field in "Advanced Options" on the Kickstart Web UI.


Version-Release number of selected component (if applicable):
spacewalk-java-2.6.18-1

How reproducible:
Create a new Kickstart profile via the wizard and select "Default Download Location."

Also, enter the distro-tree into the url field on advanced options.

Steps to Reproduce:
1. Create a KS via the wizard.
2. Select "Default Download Location"
3. View the kickstart file.

Actual results:
The distro-tree filesystem path is appended to the SW host. e.g:

http://sw-server.domain.com/var/kickstart/distro-trees/kickstart_label

Expected results:
http://sw-server.domain.com/ks/dist/org/1/label

Additional info:
This bug was introduced by 03b5989d, as part of BZ 1356173 and RHBA-2016:2662-1.

That fix incorrectly sets $media_path to the distro-tree filesystem path if the url field start with a "/". This incorrectly overrides KickstartFormatter.adjustUrlHost().

Comment 1 Laurence Rochfort 2017-03-28 11:09:11 UTC
https://github.com/spacewalkproject/spacewalk/pull/527

Comment 2 Jiří Dostál 2017-03-31 12:41:58 UTC
Hi Laurence,

if I'm correct, you described the same issue as mentioned in BZ 1388073. Fix has already been provided in nightly.

Could you please confirm that we are talking about the same issue?
Thank you

Comment 3 Laurence Rochfort 2017-04-03 08:52:43 UTC
Hi Jiří,

I think it's the same issue.

However, 99b6a15a83b2b8d749c2743e08f6cd43bd3ded16 mentioned in that BZ doesn't seem to include the functionality mentioned in BZ 1356173.

BZ 1356173 wanted any path that wasn't HTTP or FTP, and also wasn't the default download location, to be appended the the SW/proxy URI.

My fix returned correct KS URL creation, but also included that logic.

Could the SW team please discuss whether that is correct functionality?

Comment 4 Eric Herget 2017-05-09 20:49:55 UTC
I've spent some time trying to recreate this issue and compare to the PR # 527 to understand what is attempting to be fixed.  I'll set up a scenario here to help explain the behavior I see in the current code and what I think is being asked for in this BZ (and addressed in PR # 527).  Note that I've replaced my server host's FQDN with "myswsys.bogus.com".

My spacewalk server has a rhel-6.8-server-x86_64 iso mounted at
/var/distro-trees/rhel-6.8-server-x86_64

When I create a kickstart profile, the default download location is provided as
/ks/dist/org/1/rhel-6.8-server-x86_64

When I look at the resulting kickstart file, it contains
url --url http://myswsys.bogus.com/ks/dist/org/1/rhel-6.8-server-x86_64


If I go and edit the profile, and in advanced options, change the url field to be
--url /my/new/download/path

The resulting kickstart file contains
url --url http://myswsys.bogus.com/my/new/download/path


I think what is being asked, and what the PR # 527 changes, is that in the case when the url field is changed to the path on the filesystem where my distro-tree lives, and only that specific path, it should be converted to the default download location.  So in advanced options, setting url field to
--url /var/distro-trees/rhel-6.8-server-x86_64

would result in the resulting kickstart file containing
url --url http://myswsys.bogus.com/ks/dist/org/1/rhel-6.8-server-x86_64

instead of
url --url http://myswsys.bogus.com/var/distro-trees/rhel-6.8-server-x86_64


Is my assessment correct?  Am I missing anything not described here (other than specified download locations starting with "http" or "ftp" are left untouched)?

Comment 5 Laurence Rochfort 2017-05-10 08:25:55 UTC
Short answer: Yes, your assessment is correct.


Long answer:

Your assessment is correct and is how things worked prior to Spacewalk 2.6, but was broken by 03b5989d, as part of BZ 1356173 and RHBA-2016:2662-1.

PR # 527 restores the correct functionality, but adds a condition where a filesystem path that isn't the default is appended verbatim. This behaviour was introduced by 03b5989d, but broke the core "default download location" translation in the process.


For clarity, I'll add the following examples:


url field: /var/distro-trees/rhel-6.8-server-x86_64
expected result: url --url http://myswsys.bogus.com/ks/dist/org/1/rhel-6.8-server-x86_64

url field: /some/random/path
expected result: url --url http://myswsys.bogus.com/some/random/path

url field: http://some.random.com/path
expected result: url --url http://some.random.com/path

url field: ftp://some.random.com/path
expected result: url --url ftp://some.random.com/path

Comment 6 Eric Herget 2017-05-12 18:57:07 UTC
spacewalk.github:
b28e0a472c9533ecd6b29352a80d156cadf01ade
01b7bea8d6695ea83b2667af246ee4c148ae2f00

Comment 7 Tomas Lestach 2017-08-14 14:24:00 UTC
Eric, I see neither of the commits (stated in Comment 6) in spacewalk.git. Can you, please, make sure correct hashes are stated?

Comment 8 Eric Herget 2017-08-14 14:51:46 UTC
Weird.  Not sure what I did there.  The two commits are:

spacewalk.github
3302b7deea106c879708e39633996b2f6c39f4f3
a281e151586f745ec7ac301b99f55010cbebb2f8

Comment 9 Tomas Lestach 2017-08-14 14:57:46 UTC
Thank you.

Comment 10 Eric Herget 2017-09-27 19:33:42 UTC
Spacewalk 2.7 has been released.

https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes27


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