<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Ilya, thanks for digging this far!  Any advice on how to fix this issue?  </div><div><br></div><div>Thanks!</div><div>KC</div><br><div><div>On Jun 27, 2013, at 9:42 AM, Ilya Shakhat wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">KC, it looks like I've found the cause, and it is related to the way how firewall_rules_list is serialized/deserialized.<div><br></div><div>After fixing issue with plural form of firewall_policy (quantum/v2_0/__init__.py line # 511), tox fails only with one error in test_create_firewall_policy_with_all_params for xml format. The issue is that mox doesn't get message body it is told to catch. The difference is visible in test_cli20 #137 (MyComparator.equals):</div>
<div>  expects:</div><div>      {'firewall_policy': {'firewall_rules_list': ['rule_id1'], 'tenant_id': 'my-tenant', 'name': 'my-name', 'admin_state_up': True}}</div>
<div>  gets:</div><div>      {'firewall_policy': {'firewall_rules_list': {'item': 'rule_id1'}, 'tenant_id': 'my-tenant', 'name': 'my-name', 'admin_state_up': True}}</div>
<div><br></div><div>Ilya.<br><br><div class="gmail_quote">2013/6/27 Kuang-Ching Wang <span dir="ltr"><<a href="mailto:kuangching.wang@gmail.com" target="_blank">kuangching.wang@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div>Ilya, thanks for catching this - I took care of the plural, though the POST error earlier still persists.  </div><div><br></div><div>Any idea why the expected call breaks into two sections - the call itself and the body separated?</div>
<span class="HOEnZb"><font color="#888888"><div><br></div><div>KC</div></font></span><div><div class="h5"><br><div><div>On Jun 26, 2013, at 1:18 PM, Ilya Shakhat wrote:</div><br><blockquote type="cite">Hi KC, <br><br>There's one more place in code that relies on rule of making plurals, it adds letter 's' producing 'policys' instead of 'policies'. The code is in quantum/v2_0/__init__.py line # 511.<br>

<br>Thanks,<br>Ilya  <br><br><div class="gmail_quote">2013/6/26 Kuang-Ching Wang <span dir="ltr"><<a href="mailto:kuangching.wang@gmail.com" target="_blank">kuangching.wang@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word">Hi Eugene,<div><br></div><div>thanks for looking into this.  I just pushed my patch: <a href="https://review.openstack.org/#/c/33187/" target="_blank">https://review.openstack.org/#/c/33187/</a></div>

<div><br></div><div>Thanks!</div><span><font color="#888888"><div>KC</div></font></span><div><div><div><br><div><div>On Jun 25, 2013, at 9:08 PM, Eugene Nikanorov <<a href="mailto:enikanorov@mirantis.com" target="_blank">enikanorov@mirantis.com</a>> wrote:</div>

<br><blockquote type="cite"><div dir="ltr">Hi,<div><br></div><div>Can you post the code if failing test?</div><div><br></div><div>Eugene.</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">

On Wed, Jun 26, 2013 at 2:11 AM, Kuang-Ching Wang <span dir="ltr"><<a href="mailto:kuangching.wang@gmail.com" target="_blank">kuangching.wang@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I am seeing the following error and cannot figure out why it happened and how to solve it.  Any advice would be appreciated.  Thanks!<br>
<br>
UnexpectedMethodCallError: Unexpected method call.  unexpected:-  expected:+<br>
- request.__call__('localurl/v2.0/firewall_policies.xml', 'POST', body='<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<firewall_policy xmlns="<a href="http://openstack.org/quantum/api/v2.0" target="_blank">http://openstack.org/quantum/api/v2.0</a>" xmlns:quantum="<a href="http://openstack.org/quantum/api/v2.0" target="_blank">http://openstack.org/quantum/api/v2.0</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"><description>my-desc</description><admin_state_up quantum:type="bool">True</admin_state_up><tenant_id>my-tenant</tenant_id><firewall_rules_list><item>rule_id1</item></firewall_rules_list><shared quantum:type="bool">True</shared><audited quantum:type="bool">True</audited><name>my-name</name></firewall_policy>', headers={'X-Auth-Token': 'testtoken', 'Content-Type': 'application/xml', 'Accept': 'application/xml', 'User-Agent': 'python-quantumclient'}) -> None<br>



+ request.__call__('localurl/v2.0/firewall_policies.xml', 'POST', body=<?xml version='1.0' encoding='UTF-8'?><br>
<br>
+ <firewall_policy xmlns="<a href="http://openstack.org/quantum/api/v2.0" target="_blank">http://openstack.org/quantum/api/v2.0</a>" xmlns:quantum="<a href="http://openstack.org/quantum/api/v2.0" target="_blank">http://openstack.org/quantum/api/v2.0</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"><tenant_id>my-tenant</tenant_id><description>my-desc</description><admin_state_up quantum:type="bool">True</admin_state_up><firewall_rules_list><item>rule_id1</item></firewall_rules_list><shared quantum:type="bool">True</shared><audited quantum:type="bool">True</audited><name>my-name</name></firewall_policy>, headers=<map containing the entry 'X-Auth-Token: testtoken'>) -> (<tests.unit.test_cli20.MyResp object at 0x3156d90>, '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<firewall_policy xmlns="<a href="http://openstack.org/quantum/api/v2.0" target="_blank">http://openstack.org/quantum/api/v2.0</a>" xmlns:quantum="<a href="http://openstack.org/quantum/api/v2.0" target="_blank">http://openstack.org/quantum/api/v2.0</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"><id>myid</id><name>my-name</name></firewall_policy>')<br>



<br>
KC<br>
<br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div><br></div>
_______________________________________________<br>OpenStack-dev mailing list<br><a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>

</blockquote></div><br></div></div></div></div><br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br>
_______________________________________________<br>OpenStack-dev mailing list<br><a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div><br></div></div></div><br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>OpenStack-dev mailing list<br><a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev<br></blockquote></div><br></body></html>