Bug 1014693 - hostrequire should not process args other than verify it is valid xml.
Summary: hostrequire should not process args other than verify it is valid xml.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: 0.14
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: 0.17
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-02 14:38 UTC by Bill Peck
Modified: 2018-02-06 00:41 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-10 23:28:05 UTC
Embargoed:


Attachments (Terms of Use)

Description Bill Peck 2013-10-02 14:38:44 UTC
Description of problem:
Change --hostrequire to simply pass its argument as a child to <hostRequire>

Currently it's impossible to pass a requirement on <device/> from the command line.

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

How reproducible:


Steps to Reproduce:
1. bkr workflow-simple --dryrun --distro rhel-6.4 --arch x86_64 --variant Server --hostrequire "<device/>" --task /distribution/reservesys

Actual results:
Traceback (most recent call last):
  File "/usr/bin/bkr", line 9, in <module>
    load_entry_point('bkr.client==0.14.1', 'console_scripts', 'bkr')()
  File "/usr/lib/python2.7/site-packages/bkr/client/main.py", line 50, in main
    return cmd.run(*cmd_args, **cmd_opts.__dict__)
  File "/usr/lib/python2.7/site-packages/bkr/client/commands/cmd_workflow_simple.py", line 101, in run
    recipeTemplate.addBaseRequires(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/bkr/client/__init__.py", line 634, in addBaseRequires
    key, op, value = p2.split(require,3)


Expected results:
pass the valid xml through to the job xml.

Comment 2 Dan Callaghan 2013-10-02 23:40:48 UTC
We would need to continue supporting the existing usage of --hostrequires though, which doesn't work for <device/> but does work for most other XML filters.

We could probably pass the value through directly if it begins with <, otherwise use the existing operator parsing logic.

Comment 3 Nick Coghlan 2013-10-03 01:50:53 UTC
Dan's suggested approach sounds good to me (and relatively straightforward).

Comment 5 Dan Callaghan 2014-05-08 05:21:02 UTC
On Gerrit: http://gerrit.beaker-project.org/3073

Comment 9 Dan Callaghan 2014-06-02 04:39:56 UTC
This bug fix has been applied to the release-0.16 branch, however we have elected not to do another maintenance release of the 0.16.x series. This fix will be included in 0.17.0 instead.

Comment 10 Dan Callaghan 2014-06-10 23:28:05 UTC
Beaker 0.17.0 has been released.


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