<div dir="ltr">Thanks, I used the suggested code modification and it worked; however, I have encountered a new and interesting problem.<div><br></div><div style>My build_query is set up as follows:</div><div style><br></div>
<div style>
<p class=""><span class=""><code><br>status=</span>'NEW, ASSIGNED, ON_DEV, POST, MODIFIED, ON_QA'<br></p></div><div style>
<p class="">query_in = bz.build_query(</p>
<p class=""> product = <span class="">"Red Hat Enterprise MRG"</span>,<br> component = MRGM,<br> flag = <span class="">'</span><span class="">mrg</span><span class="">-2.4.0'</span>,<br>
status = status,<br> boolean_query = [bz_boolean])</p><p class="">
</p><p class="">query_out = bz.query(query_in)<br></code></p><p class="">query_out includes bugs that are in the CLOSED state as well. I assumed that my built query was ANDed so all conditions had to be true to satisfy.</p>
<p class="" style>Thoughts?</p><p class="" style>Thanks!<br>Eric</p><p></p></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 24, 2013 at 4:58 PM, Cole Robinson <span dir="ltr"><<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 04/24/2013 04:02 PM, Eric Sammons wrote:<br>
> Hi,<br>
><br>
> I'm trying to write a simple python program that would search for all bugs<br>
> with a specific set of flags. Using the bugzilla cli the boolean query works.<br>
><br>
> <cli><br>
> bugzilla query --product='Red Hat Enterprise MRG' --component='distribution,<br>
> qpid-cpp, qpid-java, qpid-jca'<br>
> --boolean_query='flagtypes.name-substring-mrg-2.4.0 &<br>
> flagtypes.name-notsubstring-mrg-2.4.0-'<br>
> </cli><br>
><br>
> When I try to use the following, I receive a malformed boolean error.<br>
><br>
> <code><br>
> bz_boolean = 'flagtypes.name-substring-mrg-2.4.0 &<br>
> flagtypes.name-notsubstring-mrg-2.4.0-'<br>
> bz = bugzilla.Bugzilla(url = bzurl)<br>
> query_in = bz.build_query(<br>
> product = "Red Hat Enterprise MRG",<br>
> component = MRGM,<br>
> boolean_query = bz_boolean)<br>
> query_out = bz.query(query_in)<br>
> for i in query_out:<br>
> print i<br>
> </code><br>
><br>
> RuntimeError: Malformed boolean query: flagtypes.name-substring-mrg-2.4.0 &<br>
> flagtypes.name-notsubstring-mrg-2.4.0-<br>
><br>
> What am I doing wrong here or is it possible there is a bug in the library?<br>
<br>
</div></div>Yep, it's a bug. The API wanted boolean_query only as a list. I've pushed a<br>
commit now that handles it as both a string and a list.<br>
<br>
If you aren't using git, you can fix it by altering your code above like<br>
<br>
...<br>
boolean_query = [bz_boolean])<br>
...<br>
<span class="HOEnZb"><font color="#888888"><br>
- Cole<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Eric L. Sammons <a href="mailto:esammons@redhat.com" target="_blank">esammons@redhat.com</a><br>Manager Quality Engineering irc: eanxgeek<br>
Red Hat Quality Engineering 919.754.4963 (w)<br>rhce # 805007668329332 919.889.3279 (c) <br>rhcva # 805007668329332 <br><br>
</div>