我写了一些python代码与Openstack实例进行交互;使用shade库。连接到OpenStack失败
呼叫
myinstance = shade.openstack_cloud(cloud='mycloud', **auth_data)
工作在我的本地Ubuntu安装罚款;但在我们的“后端”服务器上运行失败(运行RHEL 7.2)。
File "mystuff/core.py", line 248, in _create_connection myinstance = shade.openstack_cloud(cloud='mycloud', **auth_data)
File "/usr/local/lib/python3.5/site-packages/shade-1.20.0-py3.5.egg/shade/init.py", line 106, in openstack_cloud return OpenStackCloud(cloud_config=cloud_config, strict=strict)
File "/usr/local/lib/python3.5/site-packages/shade-1.20.0-py3.5.egg/shade/openstackcloud.py", line 312, in init self._local_ipv6 = _utils.localhost_supports_ipv6()
File "/usr/local/lib/python3.5/site-packages/shade-1.20.0-py3.5.egg/shade/_utils.py", line 254, in localhost_supports_ipv6 return netifaces.AF_INET6 in netifaces.gateways()['default']
AttributeError: module 'netifaces' has no attribute 'AF_INET6'
该系统的管理员告诉我在那里没有启用IPv6;也许这就解释了失败。我做了一些研究,但没有找到任何防止失败的方法。
任何的想法是受欢迎的。
更新:我编辑了我的clouds.yml;它看起来像这样:
# openstack/shade config file
# required to connect provisioning using the shade module
client:
force_ipv4: true
clouds:
mycloud:
auth:
user_domain_name: xxx
auth_url: 'someurl'
region_name: RegionOne
我也试过export OS_FORCE_IPV4=True
- 但错误信息仍然存在。
我无法复制您的问题,因此只是添加了一个可能的解决方案。 – Rahul
谢谢@GhostCat – Rahul