<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="">&lt;code&gt;<br>status=</span>&#39;NEW, ASSIGNED, ON_DEV, POST, MODIFIED, ON_QA&#39;<br></p></div><div style>







<p class="">query_in = bz.build_query(</p>
<p class="">                              product = <span class="">&quot;Red Hat Enterprise MRG&quot;</span>,<br>                              component = MRGM,<br>                              flag = <span class="">&#39;</span><span class="">mrg</span><span class="">-2.4.0&#39;</span>,<br>
                              status = status,<br>                              boolean_query = [bz_boolean])</p><p class="">







</p><p class="">query_out = bz.query(query_in)<br>&lt;/code&gt;</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">&lt;<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a>&gt;</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>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m trying to write a simple python program that would search for all bugs<br>
&gt; with a specific set of flags.  Using the bugzilla cli the boolean query works.<br>
&gt;<br>
&gt; &lt;cli&gt;<br>
&gt; bugzilla query --product=&#39;Red Hat Enterprise MRG&#39; --component=&#39;distribution,<br>
&gt; qpid-cpp, qpid-java, qpid-jca&#39;<br>
&gt; --boolean_query=&#39;flagtypes.name-substring-mrg-2.4.0 &amp;<br>
&gt; flagtypes.name-notsubstring-mrg-2.4.0-&#39;<br>
&gt; &lt;/cli&gt;<br>
&gt;<br>
&gt; When I try to use the following, I receive a malformed boolean error.<br>
&gt;<br>
&gt; &lt;code&gt;<br>
&gt; bz_boolean = &#39;flagtypes.name-substring-mrg-2.4.0 &amp;<br>
&gt; flagtypes.name-notsubstring-mrg-2.4.0-&#39;<br>
&gt; bz = bugzilla.Bugzilla(url = bzurl)<br>
&gt; query_in = bz.build_query(<br>
&gt;                               product = &quot;Red Hat Enterprise MRG&quot;,<br>
&gt;                               component = MRGM,<br>
&gt;                               boolean_query = bz_boolean)<br>
&gt; query_out = bz.query(query_in)<br>
&gt; for i in query_out:<br>
&gt;     print i<br>
&gt; &lt;/code&gt;<br>
&gt;<br>
&gt; RuntimeError: Malformed boolean query: flagtypes.name-substring-mrg-2.4.0 &amp;<br>
&gt; flagtypes.name-notsubstring-mrg-2.4.0-<br>
&gt;<br>
&gt; What am I doing wrong here or is it possible there is a bug in the library?<br>
<br>
</div></div>Yep, it&#39;s a bug. The API wanted boolean_query only as a list. I&#39;ve pushed a<br>
commit now that handles it as both a string and a list.<br>
<br>
If you aren&#39;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>