[openstack-dev] [all] Question about import module

liuxinguo liuxinguo at huawei.com
Fri Jan 30 02:10:13 UTC 2015


*         I have seen that the module 'oslo.config' have changed to 'oslo_config' in Kilo but in Juno it is still 'oslo.config'.

I want my code work compatibly both for Juno and Kilo so I import this module in this way:

try:
    from oslo_config import cfg
except:
from oslo.config import cfg

*         Does this way of importing module will be accepted by the community<app:ds:community>? Or is there any other better way<app:ds:way>?

Thanks and regards,
Liu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150130/1ece186a/attachment.html>


More information about the OpenStack-dev mailing list