Bug 1078941 - workflow commands with no arch specified cause XML-RPC fault: AttributeError: 'OSMajor' object has no attribute 'osminor'
Summary: workflow commands with no arch specified cause XML-RPC fault: AttributeError:...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: web UI
Version: 0.16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 0.16.1
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-20 15:08 UTC by Bill Peck
Modified: 2018-02-06 00:41 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-03-26 23:54:29 UTC
Embargoed:


Attachments (Terms of Use)

Description Bill Peck 2014-03-20 15:08:39 UTC
Description of problem:
If you pass in a family without an arch in any of the workflows it will make a call to the server to get a list of arches.  This fails with a traceback.

Mar 20 13:15:53 beaker-02 beaker-server[5985]:    File "/usr/lib/python2.6/site-packages/bkr/server/distro.py", line 91, in get_arch
Mar 20 13:15:53 beaker-02 beaker-server[5985]:      arches = [arch.arch for arch in OSMajor.by_name(filter['osmajor']).osminor[0].arches]
Mar 20 13:15:53 beaker-02 beaker-server[5985]:  AttributeError: 'OSMajor' object has no attribute 'osminor'


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

How reproducible:
Everytime

Steps to Reproduce:
1. bkr workflow-simple --family Fedora19 --task /distribution/install

Additional info:

Fix:
diff --git a/Server/bkr/server/distro.py b/Server/bkr/server/distro.py
index fe13d7e..bb19dd6 100644
--- a/Server/bkr/server/distro.py
+++ b/Server/bkr/server/distro.py
@@ -88,7 +88,7 @@ def get_arch(self, filter):
         elif 'osmajor' in filter:
             # look up osmajor
             try:
-                arches = [arch.arch for arch in OSMajor.by_name(filter['osmajor']).osminor[0].arches]
+                arches = [arch.arch for arch in OSMajor.by_name(filter['osmajor']).osversion[0].arches]
             except InvalidRequestError:
                 raise BX(_('Invalid OSMajor: %s' % filter['osmajor']))
         return arches

Comment 3 Bill Peck 2014-03-20 15:49:35 UTC
possible patch

http://gerrit.beaker-project.org/#/c/2941/

Comment 4 Dan Callaghan 2014-03-21 01:20:41 UTC
This was a regression in 0.16.0 due to SQLAlchemy declarative conversion. The OSMajor.osminor property (which is, confusingly, actually a list of OSVersions) was mistakenly renamed to OSMajor.osversion.

Rather than the patch in comment 3 I think we should just change back the property name.

Comment 5 Dan Callaghan 2014-03-21 01:38:11 UTC
http://gerrit.beaker-project.org/2943

Comment 7 xjia 2014-03-24 10:40:45 UTC
Verify:
[root@qe-xjia-beaker-client ~]# bkr workflow-simple --family RedHatEnterpriseLinux6  --task /distribution/install --tag None
Submitted: ['J:3967']
[root@qe-xjia-beaker-client ~]# bkr workflow-simple --family RedHatEnterpriseLinux6  --task /distribution/install
Exception: <Fault 1: '<class \'bkr.common.bexceptions.BX\'>:No distro tree matches Recipe: <distroRequires><and><distro_family value="RedHatEnterpriseLinux6" op="="></distro_family><distro_tag value="STABLE" op="="></distro_tag><distro_method value="nfs" op="="></distro_method><distro_arch value="i386" op="="></distro_arch></and></distroRequires>'>

Version:
beaker-0.16.1-0.git.17.c71cd22.el6eng.noarch
beaker-client-0.16.1-0.git.17.c71cd22.el6eng.noarch

Comment 8 Dan Callaghan 2014-03-26 23:54:29 UTC
Beaker 0.16.1 has been released.


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