<div dir="ltr"><div>Hi Doug,</div><div><br></div><div> Thank you very much for your reply. I don't have any codes, so no any special codes as well.</div><div> Only thing I did is that:</div><div> 1, use devstack to install a fresh openstack env, all are ok.</div><div> 2, import neutron-vpnaas directory (no any my own codes) into eclipse as pydev project, for example, run unit test (neutron_vpnaas.tests.unit.services.vpn.test_vpn_service ) in eclipse, it throws the following exception.</div><div> 3, but this unit test can be run well in bash, see <a href="http://paste.openstack.org/show/172016/">http://paste.openstack.org/show/172016/</a></div><div> 4, this unit test can also be run well in eclipse as long as I edit neutron/openstack/common/policy.py file to change oslo.config into oslo_config.</div><div><br></div><div><br></div><div>======================================================================</div><div>ERROR: test_add_nat_rule (neutron_vpnaas.tests.unit.services.vpn.test_vpn_service.TestVPNDeviceDriverCallsToService)</div><div>neutron_vpnaas.tests.unit.services.vpn.test_vpn_service.TestVPNDeviceDriverCallsToService.test_add_nat_rule</div><div>----------------------------------------------------------------------</div><div>_StringException: Traceback (most recent call last):</div><div> File "/bak/openstack/neutron-vpnaas/neutron_vpnaas/tests/unit/services/vpn/test_vpn_service.py", line 98, in setUp</div><div> super(TestVPNDeviceDriverCallsToService, self).setUp()</div><div> File "/bak/openstack/neutron-vpnaas/neutron_vpnaas/tests/unit/services/vpn/test_vpn_service.py", line 53, in setUp</div><div> super(VPNBaseTestCase, self).setUp()</div><div> File "/bak/openstack/neutron-vpnaas/neutron_vpnaas/tests/base.py", line 36, in setUp</div><div> override_nvalues()</div><div> File "/bak/openstack/neutron-vpnaas/neutron_vpnaas/tests/base.py", line 30, in override_nvalues</div><div> cfg.CONF.set_override('policy_file', neutron_policy)</div><div> File "/usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py", line 1679, in __inner</div><div> result = f(self, *args, **kwargs)</div><div> File "/usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py", line 1949, in set_override</div><div> opt_info = self._get_opt_info(name, group)</div><div> File "/usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py", line 2262, in _get_opt_info</div><div> raise NoSuchOptError(opt_name, group)</div><div>NoSuchOptError: no such option: policy_file</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 10, 2015 at 10:38 PM, Doug Hellmann <span dir="ltr"><<a href="mailto:doug@doughellmann.com" target="_blank">doug@doughellmann.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
On Tue, Feb 10, 2015, at 04:29 AM, Joshua Zhang wrote:<br>
> Hi Stacker,<br>
> A question about oslo.config, maybe a very silly question. but pls<br>
> tell<br>
> me if you know, thanks in advance.<br>
><br>
> I know oslo has removed 'olso' namespace, oslo.config has been changed<br>
> to oslo_config, it also retains backwards compat.<br>
><br>
> I found I can run openstack successfully, but as long as I run<br>
> something<br>
> in eclipse/pydev it always said like 'NoSuchOptError: no such option:<br>
> policy_file'. I can change 'oslo.config' to 'oslo_config' in<br>
> neutron/openstack/common/policy.py temporarily to bypass this problem<br>
> when<br>
> I want to debug something in eclipse. But I want to know why? who can<br>
> help<br>
> me to explain ? thanks.<br>
<br>
</span>It sounds like you have code in one module using an option defined<br>
somewhere else and relying on import ordering to cause that option to be<br>
defined. The import_opt() method of the ConfigOpts class is meant to<br>
help make these cross-module option dependencies explicit [1]. If you<br>
provide a more detailed traceback I may be able to give more specific<br>
advice about where changes are needed.<br>
<br>
Doug<br>
<br>
[1]<br>
<a href="http://docs.openstack.org/developer/oslo.config/configopts.html?highlight=import_opt#oslo_config.cfg.ConfigOpts.import_opt" target="_blank">http://docs.openstack.org/developer/oslo.config/configopts.html?highlight=import_opt#oslo_config.cfg.ConfigOpts.import_opt</a><br>
<span class=""><br>
><br>
><br>
> --<br>
> Best Regards<br>
> Zhang Hua(张华)<br>
> Software Engineer | Canonical<br>
> IRC: zhhuabj<br>
</span>> __________________________________________________________________________<br>
> OpenStack Development Mailing List (not for usage questions)<br>
> Unsubscribe:<br>
> <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</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>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</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><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best Regards</div><div>Zhang Hua(张华)</div><div>Software Engineer | Canonical</div><div>IRC: zhhuabj</div></div></div>
</div>