Bug 591549 - Check upgrade path for cobbler 1.6.6 to 2.X
Check upgrade path for cobbler 1.6.6 to 2.X
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Upgrades (Show other bugs)
530
All Linux
urgent Severity high
: ---
: ---
Assigned To: Michael Mráka
Martin Minar
:
Depends On:
Blocks: sat540-upgrades
  Show dependency treegraph
 
Reported: 2010-05-12 10:33 EDT by Michael Mráka
Modified: 2016-07-03 20:55 EDT (History)
6 users (show)

See Also:
Fixed In Version: rhn-upgrade-5.4.0.10-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-10-28 10:57:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Mráka 2010-05-12 10:33:07 EDT
Description of problem:

According to an email thread in spacewalk-list http://www.mail-archive.com/spacewalk-list@redhat.com/msg04590.html
there might be necessery to create upgrade scripts for kickstart snippet migration for sat5.3 -> sat6.0.


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

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
...
Looks like something borked in the api spacewalk liases with on
upgrade (or version) as my kickstarts had snippets in them that had
not be expanded when viewing the kickstarts. note that 'some'
kickstart snippets did expand... it was a bit weird ^^

Calling cobbler sync from the spacewalk UI and tailing the cobbler log
files didnt' show much, if anything, happening.

Reverting cobbler to 1.6.6 then rerunning cobbler sync showed the api
being used to sync up cobbler with the spacewalk database.
...
I have the same problem. I replaced the $variable of my snippet by \$variable 
and its work. But I have others litle problem to solve yet.
Comment 1 Michael Mráka 2010-09-29 08:01:08 EDT
What I checked:
- installed satellite 5.3 with cobbler 1.6
- created kickstart profile with number of $variables
- checked visualy files in /var/lib/rhn/kickstarts/snippets/
- successfully kickstarted client system
then
- upgraded to satellite 5.4 with cobbler 2.0
- visualy checked files in /var/lib/rhn/kickstarts/snippets/ (no change since sat 5.3)
- successfully kickstarted client system

No changes / upgrade script was needed.
Comment 2 Martin Minar 2010-10-14 03:35:10 EDT
Ok, I have reproduced it.

1. Create kickstart profile in Systems > Kickstart
2. Create snippet in Systems > Kickstart > Kickstart Snippets
For example:
export test=`uname -a`
echo $test
3. Go to your kickstart profile into System Details > Partitioning
Add $SNIPPET(<PATH_TO_YOUR_SNIPPET>) at the end
4. Check Kickstart File
 - In 5.3 version (cobbler 1.6) there is content of snippet expanded
 - In 5.4 version (cobbler 2.0) there in just $SNIPPET(...) line

Also note that when you add snippet line ($SNIPPET) into Scripts > add new scripts it will not be expanded in Kickstart File in neither version of cobbler.


I can also confirm, that escaping $ is helping. That's the reason why some snippets got expanded (those without $) and some not.
Comment 3 Martin Minar 2010-10-14 07:26:02 EDT
Confirmed that upgrade from 5.3 to 5.4 (from 1.6 cobbler to 2.0) generated kickstart file WITHOUT expanded snippet.

Propose solution:
- Add escaping of $ into upgrade.
Comment 4 Michael Mráka 2010-10-14 09:52:34 EDT
It's about content of snippet not the snippet references in ksfile.

Snippets are not stored in db but directly in files on disk.

So it's not a schema-upgrade stuff.
IMHO we have 2 options here:
a) create upgrade script and put it into rhn-upgrade (+ instruction how/when to use)
b) as we re-package cobbler rpm for satellite we can put the script to post-upgrade section.
Comment 5 Martin Minar 2010-10-15 04:33:22 EDT
I would also suggest to either put note on snippet creation page that if user want's to use $, he should escape it with \ or check the form submit operation that in fact creates a snippet file to escape $s.

As this bug is only about upgrading, maybe create new bug for creation.
Comment 6 Michael Mráka 2010-10-15 06:09:01 EDT
Instead of escaping all $ signs we can put '#raw' in the beginning of snippet.
Comment 7 Michael Mráka 2010-10-15 09:43:42 EDT
There's already a cobbler ticket about this: https://fedorahosted.org/cobbler/ticket/587
Comment 8 Michael Mráka 2010-10-15 15:10:49 EDT
Fixed in satellite git by
commit ae811596334f9ac198bab582bcc7b9d8f2c852fc
    591549 - avoid $variable expansion in snippets
Comment 12 Clifford Perry 2010-10-28 10:52:31 EDT
The 5.4.0 RHN Satellite and RHN Proxy release has occurred. This issue has been resolved with this release. 


RHEA-2010:0801 - RHN Satellite Server 5.4.0 Upgrade
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10332

RHEA-2010:0803 - RHN Tools enhancement update
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10333

RHEA-2010:0802 - RHN Proxy Server 5.4.0 bug fix update
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10334

RHEA-2010:0800 - RHN Satellite Server 5.4.0
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10335

Docs are available:

http://docs.redhat.com/docs/en-US/Red_Hat_Network_Satellite/index.html 

Regards,
Clifford

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