http://gerrit.beaker-project.org/#/c/2778/1
(In reply to xjia from comment #0) > Description of problem: > From the manufacture, we know that: > beaker-create-kickstart --user <username> (--recipe-id <recipeid> | --system > <fqdn> --distro-tree-id <distrotreeid>) [options] > > So that means user can only use "--recipe-id" or use "--system" and > "--distro-tree-id". But the command line doesn't restrict this. Actually the synopsis is just trying to say: if you don't specify a recipe id, you must specify both a system and a distro tree id. Which is true, and is enforced by the command. But recipe id and system aren't mutually exclusive. The way it should work is: if you pass a recipe id *and* a system, it generates the kickstart based on the given recipe but with the system overriden to be the one passed in. That would be a useful behaviour for testing the generated kickstart. So for this bug fix we just need to make sure that it does indeed work that way, and to add an explanation under --system in the man page: "When used with the --recipe-id option, this overrides the system from the recipe."
(In reply to Dan Callaghan from comment #3) > (In reply to xjia from comment #0) > > Description of problem: > > From the manufacture, we know that: > > beaker-create-kickstart --user <username> (--recipe-id <recipeid> | --system > > <fqdn> --distro-tree-id <distrotreeid>) [options] > > > > So for this bug fix we just need to make sure that it does indeed work that > way, and to add an explanation under --system in the man page: "When used > with the --recipe-id option, this overrides the system from the recipe." This is what I see: # beaker-create-kickstart -r 192 -f my.system.bar -d 21 (The system doesn't exist) Output: /usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py:459: SAWarning: Unicode type received non-unicode bind param value param.append(processors[key](compiled_params[key])) Traceback (most recent call last): File "/usr/bin/beaker-create-kickstart", line 9, in <module> load_entry_point('bkr.server==0.15.3', 'console_scripts', 'beaker-create-kickstart')() File "/usr/lib/python2.7/site-packages/bkr/server/tools/create_kickstart.py", line 47, in main system = System.by_fqdn(fqdn, user) File "/usr/lib/python2.7/site-packages/bkr/server/model.py", line 2294, in by_fqdn return System.all(user).filter(System.fqdn == fqdn).one() File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2316, in one raise orm_exc.NoResultFound("No row was found for one()") sqlalchemy.orm.exc.NoResultFound: No row was found for one() So, it looks like it is trying to find the system, instead of just using the supplied one to generate the kickstart. IIUC, this is the actual bug?
(In reply to Amit Saha from comment #4) > (In reply to Dan Callaghan from comment #3) > > (In reply to xjia from comment #0) > > > Description of problem: > > > From the manufacture, we know that: > > > beaker-create-kickstart --user <username> (--recipe-id <recipeid> | --system > > > <fqdn> --distro-tree-id <distrotreeid>) [options] > > > > > > > So for this bug fix we just need to make sure that it does indeed work that > > way, and to add an explanation under --system in the man page: "When used > > with the --recipe-id option, this overrides the system from the recipe." > > This is what I see: > > # beaker-create-kickstart -r 192 -f my.system.bar -d 21 > > (The system doesn't exist) > > Output: > > > /usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py:459: > SAWarning: Unicode type received non-unicode bind param value > param.append(processors[key](compiled_params[key])) > Traceback (most recent call last): > File "/usr/bin/beaker-create-kickstart", line 9, in <module> > load_entry_point('bkr.server==0.15.3', 'console_scripts', > 'beaker-create-kickstart')() > File > "/usr/lib/python2.7/site-packages/bkr/server/tools/create_kickstart.py", > line 47, in main > system = System.by_fqdn(fqdn, user) > File "/usr/lib/python2.7/site-packages/bkr/server/model.py", line 2294, in > by_fqdn > return System.all(user).filter(System.fqdn == fqdn).one() > File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line > 2316, in one > raise orm_exc.NoResultFound("No row was found for one()") > sqlalchemy.orm.exc.NoResultFound: No row was found for one() > > > So, it looks like it is trying to find the system, instead of just using the > supplied one to generate the kickstart. I think i have stopped thinking. Ignore please.
I uploaded a revised patch which makes sure that the following is the behavior of the tool: - When both --system and --recipe-id are specified, use the system specified, rathern the one that the recipe ran against. - If --distro-tree-id is specified, use that else, use the that the recipe used. http://gerrit.beaker-project.org/#/c/2778/
Other higher priority issues came up in 0.15.3, postponing this change.
Beaker 0.16.0 has been released.