Bug 972417

Summary: [ cmd_workflow ] clients and servers should be used together.
Product: [Retired] Beaker Reporter: Xin Zhang <xinzhang>
Component: command lineAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: wangjing <jingwang>
Severity: low Docs Contact:
Priority: unspecified    
Version: 0.12CC: asaha, dcallagh, jingwang, llim, qwan, rglasz, rmancy, szhou, xjia
Target Milestone: 0.13.x   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-11 02:44:51 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:

Description Xin Zhang 2013-06-09 09:26:32 UTC
Description of problem:
When running bkr workflow-simple --clients=<number> and bkr workflow-simple --servers=<number> separately, it will return errors; while running bkr workflow --clients=<number> --servers=<number>, it will execute successfully.

Version-Release number of selected component (if applicable):
beaker-0.12.1-1.git.199.c06a860.el6eng.noarch
beaker-client-0.12.1-1.git.199.c06a860.el6eng.noarch

How reproducible:
always

Steps to Reproduce:
1.bkr workflow-simple --distro RHEL6.4-20130130.0 --task /distribution/install --clients=<number>
2.bkr workflow-simple --distro RHEL6.4-20130130.0 --task /distribution/install --servers=<number>
3.bkr workflow-simple --distro RHEL6.4-20130130.0 --task /distribution/install --clients=<number> --servers=<number>

Actual results:
Running 1&2 will return:
Traceback (most recent call last):
  File "/usr/bin/bkr", line 9, in <module>
    load_entry_point('bkr.client==0.12.1', 'console_scripts', 'bkr')()
  File "/usr/lib/python2.6/site-packages/bkr/client/main.py", line 49, in main
    return cmd.run(*cmd_args, **cmd_opts.__dict__)
  File "/usr/lib/python2.6/site-packages/bkr/client/commands/cmd_workflow_simple.py", line 110, in run
    for i in range(self.n_servers):
TypeError: range() integer end argument expected, got NoneType.

Running 3 will return:
Submitted:[ 'J:***' ]

Expected results:
When running 1&2, it will remind user that clients and servers should be used together.

Additional info:

Comment 1 Dan Callaghan 2013-06-17 06:35:18 UTC
I think it's perfectly valid to run without clients or servers. If I pass --clients=2 that just means I want 2 clients and no servers. So the default value for both options should be 0 (rather than None, which it is now, hence the TypeError).

Comment 2 Dan Callaghan 2013-06-17 06:45:04 UTC
On Gerrit: http://gerrit.beaker-project.org/2032

Comment 3 Dan Callaghan 2013-06-20 07:18:58 UTC
This bug fix is included in beaker-0.13.1-1.git.16.497fc35.el6, which is available for download here:

http://beaker-project.org/nightlies/

Comment 4 xjia 2013-06-20 13:06:11 UTC
[root@beaker-2 ~]# bkr workflow-simple --distro RHEL6.4-20130130.0 --task /distribution/install --servers=1
Submitted: ['J:640']
[root@beaker-2 ~]# bkr workflow-simple --distro RHEL6.4-20130130.0 --task /distribution/install --clients=1
Submitted: ['J:641']
[root@beaker-2 ~]# bkr workflow-simple --distro RHEL6.4-20130130.0 --task /distribution/install --clients=1 --servers=2
Submitted: ['J:642']
[root@beaker-2 ~]# rpm -qa | grep beaker
beakerlib-1.7-1.el6eso.noarch
beaker-client-0.13.1-1.git.16.497fc35.el6.noarch
beaker-redhat-0.1.55-1.el6eng.noarch
beaker-0.13.1-1.git.16.497fc35.el6.noarch

Comment 6 Amit Saha 2013-07-11 02:44:51 UTC
Beaker 0.13.2 has been released. (http://beaker-project.org/docs/whats-new/release-0.13.html#beaker-0-13-2).