Bug 591549 - Check upgrade path for cobbler 1.6.6 to 2.X
Summary: Check upgrade path for cobbler 1.6.6 to 2.X
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Upgrades
Version: 530
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Martin Minar
Depends On:
Blocks: sat540-upgrades
TreeView+ depends on / blocked
Reported: 2010-05-12 14:33 UTC by Michael Mráka
Modified: 2016-07-04 00:55 UTC (History)
6 users (show)

Fixed In Version: rhn-upgrade-
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-10-28 14:57:31 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Michael Mráka 2010-05-12 14:33:07 UTC
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:
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 12:01:08 UTC
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
- 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 07:35:10 UTC
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
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 11:26:02 UTC
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 13:52:34 UTC
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 08:33:22 UTC
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 10:09:01 UTC
Instead of escaping all $ signs we can put '#raw' in the beginning of snippet.

Comment 7 Michael Mráka 2010-10-15 13:43:42 UTC
There's already a cobbler ticket about this: https://fedorahosted.org/cobbler/ticket/587

Comment 8 Michael Mráka 2010-10-15 19:10:49 UTC
Fixed in satellite git by
commit ae811596334f9ac198bab582bcc7b9d8f2c852fc
    591549 - avoid $variable expansion in snippets

Comment 12 Clifford Perry 2010-10-28 14:52:31 UTC
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

RHEA-2010:0803 - RHN Tools enhancement update

RHEA-2010:0802 - RHN Proxy Server 5.4.0 bug fix update

RHEA-2010:0800 - RHN Satellite Server 5.4.0

Docs are available:



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