RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1065674 - RFE: extend anaconda addon API to allow additional arguments on %addon line
Summary: RFE: extend anaconda addon API to allow additional arguments on %addon line
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: anaconda
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: David Shea
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: 1070558 1115914 1116335 1118527 1118529 1176483
TreeView+ depends on / blocked
 
Reported: 2014-02-15 17:33 UTC by David Shea
Modified: 2015-03-05 13:57 UTC (History)
2 users (show)

Fixed In Version: anaconda-19.31.82-1
Doc Type: Enhancement
Doc Text:
Feature: Add support for arguments to the kickstart %addon command. Reason: More flexible addons. Result: You can now use addon commands like %addon org_fedora_hello_word --reverse-text --text-color="blue"
Clone Of:
Environment:
Last Closed: 2015-03-05 13:57:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
anaconda.log (462 bytes, text/plain)
2014-11-25 10:50 UTC, Alexander Todorov
no flags Details
program.log (530 bytes, text/plain)
2014-11-25 10:50 UTC, Alexander Todorov
no flags Details
syslog (59.19 KB, text/plain)
2014-11-25 10:51 UTC, Alexander Todorov
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0312 0 normal SHIPPED_LIVE anaconda bug fix and enhancement update 2015-03-05 17:35:22 UTC

Description David Shea 2014-02-15 17:33:54 UTC
Anaconda provides an extension to kickstart to allow for addons, but the API for AddonData limits the parser to the text contents of the %addon section. In other words, you can currently work with something like:

%addon org_fedora_hello_world
Text goes here
%end

but it would be nice if the %addon line itself could accept additional arguments, like other kickstart sections and commands do, so that you could define an AddonData class to handle something like:

%addon org_fedora_hello_word --reverse-text --text-color="blue"
Text goes here
%end


This functionality is provided in upstream commit 3a512e4f9e15977f0ce2d0bbe39e841b881398f3

Comment 2 Alexander Todorov 2014-11-25 10:41:02 UTC
With anaconda-19.31.109-1 and exactly the same section in my ks.cfg

> %addon org_fedora_hello_word --reverse-text --text-color="blue"
> Text goes here
> %end
> 


I get an error before stage2 loads the UI:

The following problem occured on line 22 of the kickstart file:

Unhandled arguments on %addon line for org_fedora_hello_world

Comment 3 Alexander Todorov 2014-11-25 10:48:21 UTC
Looking at the addon code it does have a --reverse option but even with 

%addon org_fedora_hello_word --reverse
Text goes here
%end


I get the same error so moving back to ASSIGNED for more info.

Comment 4 Alexander Todorov 2014-11-25 10:50:37 UTC
Created attachment 961138 [details]
anaconda.log

Comment 5 Alexander Todorov 2014-11-25 10:50:55 UTC
Created attachment 961139 [details]
program.log

Comment 6 Alexander Todorov 2014-11-25 10:51:05 UTC
Created attachment 961140 [details]
syslog

Comment 7 Alexander Todorov 2014-11-25 10:57:56 UTC
I think I'm seeing the same error as in bug #1155955 which is fixed in 19.31.110

Comment 8 David Shea 2014-11-25 14:20:51 UTC
Is the addon loaded? I don't see a traceback.

Comment 9 Alexander Todorov 2014-11-26 07:13:11 UTC
(In reply to David Shea from comment #8)
> Is the addon loaded? I don't see a traceback.

I think this happens before it is loaded, while anaconda does ks.cfg parsing just before loading stage2 GUI. I will provide more info once anaconda 19.31.110-1 becomes available for testing.

Comment 10 Alexander Todorov 2014-11-26 14:59:07 UTC
Tested with anaconda 19.31.111-1 and the resulting file /root/hello_world_addon_output.txt is now present but empty. I need to see if this addon is still functioning correctly.

Comment 11 David Shea 2014-12-02 22:18:49 UTC
(In reply to Alexander Todorov from comment #3)
> %addon org_fedora_hello_word --reverse

You forgot an l (word -> world)

It does look like there's a bug in the addon related to creating the anaconda-ks.cfg file, though, so you may end up with a line

%addon org_fedora_hello_world--reverse

with no spaces. I'll send a pull request for that.

Comment 12 Alexander Todorov 2014-12-03 21:18:30 UTC
(In reply to David Shea from comment #11)
> (In reply to Alexander Todorov from comment #3)
> > %addon org_fedora_hello_word --reverse
> 
> You forgot an l (word -> world)
> 

OK, tried with correct syntax this time. I got the resulting /root/hello_world_addon_output.txt file, containing the text:
hello world


It was not reversed however.


> It does look like there's a bug in the addon related to creating the
> anaconda-ks.cfg file, though, so you may end up with a line
> 
> %addon org_fedora_hello_world--reverse
> 
> with no spaces. I'll send a pull request for that.

Also add a newline at the end. My resulting anaconda-ks.cfg is:

%addon org_fedora_hello_world--reverse
hello world
%end%addon com_redhat_kdump --enable --reserve-mb='auto'

%end



where I didn't specify the kdump addon in the original ks.cfg.

Comment 13 David Shea 2014-12-03 21:44:57 UTC
(In reply to Alexander Todorov from comment #12)
> (In reply to David Shea from comment #11)
> > (In reply to Alexander Todorov from comment #3)
> > > %addon org_fedora_hello_word --reverse
> > 
> > You forgot an l (word -> world)
> > 
> 
> OK, tried with correct syntax this time. I got the resulting
> /root/hello_world_addon_output.txt file, containing the text:
> hello world
> 
> 
> It was not reversed however.

The reversal is just in the display on the summary hub. If you use an incomplete kickstart it should show up in status reversed. It won't be reversed in the outputed kickstart, since if you had --reverse with reversed text that would be double reversed.

> > It does look like there's a bug in the addon related to creating the
> > anaconda-ks.cfg file, though, so you may end up with a line
> > 
> > %addon org_fedora_hello_world--reverse
> > 
> > with no spaces. I'll send a pull request for that.
> 
> Also add a newline at the end. My resulting anaconda-ks.cfg is:
> 
> %addon org_fedora_hello_world--reverse
> hello world
> %end%addon com_redhat_kdump --enable --reserve-mb='auto'
> 
> %end

Yep.  https://github.com/vpodzime/hello-world-anaconda-addon/commit/491bdcf10a7fdd9aa798454e49d2b37ae8991ab7

> where I didn't specify the kdump addon in the original ks.cfg.

It gets loaded since it's on the installation media.

Comment 14 Alexander Todorov 2014-12-03 21:48:20 UTC
Ok, my copy of this addon didn't do anything useful with the --reverse option. I've modified it to indicate that it was used and can now verify the original issue. 


David,
in which version do you expect to have the space/newline issue fixed? Do you need me to open another bug for that ?

Comment 15 Alexander Todorov 2014-12-03 21:50:12 UTC
(In reply to David Shea from comment #13)

> Yep. 
> https://github.com/vpodzime/hello-world-anaconda-addon/commit/
> 491bdcf10a7fdd9aa798454e49d2b37ae8991ab7
> 

OK great. Moving to VERIFIED then.

Comment 16 David Shea 2014-12-03 21:50:22 UTC
The space/newline issue is a problem in the hello world addon. The addon itself outputs its string representation, and besides getting the %addon line right it's expected to put a newline at the end. It's been fixed.

Comment 18 errata-xmlrpc 2015-03-05 13:57:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0312.html


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