Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1058156

Summary: should not allow to use "--recipe-id" and "--system" together for beaker-create-kickstart.
Product: [Retired] Beaker Reporter: xjia <xjia>
Component: command lineAssignee: Raymond Mancy <rmancy>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: low Docs Contact:
Priority: low    
Version: developCC: aigao, asaha, dcallagh, ebaak, llim, qwan, rmancy, xtian
Target Milestone: 0.16   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-17 03:01:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 2 Amit Saha 2014-02-05 05:33:25 UTC
http://gerrit.beaker-project.org/#/c/2778/1

Comment 3 Dan Callaghan 2014-02-05 08:07:08 UTC
(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."

Comment 4 Amit Saha 2014-02-06 02:53:25 UTC
(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?

Comment 5 Amit Saha 2014-02-06 02:57:44 UTC
(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.

Comment 6 Amit Saha 2014-02-07 02:56:27 UTC
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/

Comment 7 Nick Coghlan 2014-02-12 08:47:12 UTC
Other higher priority issues came up in 0.15.3, postponing this change.

Comment 10 Dan Callaghan 2014-03-17 03:01:32 UTC
Beaker 0.16.0 has been released.