Openstack 云 - boto get_all_buckets() returns 找不到元素
Openstack cloud - boto get_all_buckets() returns no element found
我正在尝试建立一个 Boto(版本 2.38)S3 连接到我的 Openstack (Juno) 云并列出容器(桶)。
这是 Python 2.7 和 swift3 中间件 (https://github.com/stackforge/swift3)。
我使用的是管理员账户,这也是我创建它们的账户,所以这应该不是权限问题。
我可以建立 ec2 连接并列出所有图像。
我也拿不到个人桶。试图检索的那个有 1 个对象,我可以在 Openstack 仪表板中看到它,并且还列出了 python-swiftclient。
如有任何建议,我们将不胜感激!
import boto
import boto.s3.connection
from boto.s3.connection import OrdinaryCallingFormat
import logging
logging.basicConfig(filename="boto.log", level=logging.DEBUG)
A_KEY = '<access_key>'
S_KEY = '<secret_key>'
s3_conn = boto.connect_s3(
aws_access_key_id=A_KEY,
aws_secret_access_key=S_KEY,
port=8080,
host='<host>',
is_secure=False,
path='/swift/v1',
validate_certs=False,
calling_format=boto.s3.connection.OrdinaryCallingFormat())
s3_conn.get_all_buckets()
###############################################
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/macleanal/Development/cl2/lib/python2.7/site-packages/boto/s3/connection.py", line 445, in get_all_buckets
xml.sax.parseString(body, h)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/__init__.py", line 49, in parseString
parser.parse(inpsrc)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 110, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 125, in parse
self.close()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 225, in close
self.feed("", isFinal = 1)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 217, in feed
self._err_handler.fatalError(exc)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/handler.py", line 38, in fatalError
raise exception
xml.sax._exceptions.SAXParseException: <unknown>:1:0: no element found
#################################################
b = s3_conn.get_bucket('Test')
#################################################
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/macleanal/Development/cl2/lib/python2.7/site-packages/boto/s3/connection.py", line 502, in get_bucket
return self.head_bucket(bucket_name, headers=headers)
File "/Users/macleanal/Development/cl2/lib/python2.7/site-packages/boto/s3/connection.py", line 549, in head_bucket
response.status, response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 204 No Content
和日志:
Thu, 01 Oct 2015 13:43:48 GMT
/swift/v1/
DEBUG:boto:Signature:
AWS <access_key>
DEBUG:boto:Final headers: {'Date': 'Wed, 30 Sep 2015 20:46:39 GMT', 'Content-Length': '0', 'Authorization': u'AWS <access_key>', 'User-Agent': 'Boto/2.38.0 Python/2.7.10 Darwin/14.5.0'}
DEBUG:boto:Response headers: [('date', 'Wed, 30 Sep 2015 20:45:32 GMT'), ('content-type', 'text/plain; charset=utf-8'), ('server', 'Apache/2.4.7 (Ubuntu)')]
/swift/v1/Test/
DEBUG:boto:Signature:
AWS <access_key>
DEBUG:boto:Final headers: {'Date': 'Thu, 01 Oct 2015 13:43:48 GMT', 'Content-Length': '0', 'Authorization': u'AWS <access_key>', 'User-Agent': 'Boto/2.38.0 Python/2.7.10 Darwin/14.5.0'}
DEBUG:boto:Response headers: [('x-container-object-count', '1'), ('server', 'Apache/2.4.7 (Ubuntu)'), ('x-container-bytes-used-actual', '4096'), ('x-container-bytes-used', '1652'), ('x-container-read', '.r:*'), ('date', 'Thu, 01 Oct 2015 13:42:39 GMT'), ('content-type', 'text/plain; charset=utf-8')]
通过使用 Swift 对象存储重新部署我们的开发云,这不再是问题。用于对象存储的 Ceph 与 Boto S3 不够兼容 API。
我正在尝试建立一个 Boto(版本 2.38)S3 连接到我的 Openstack (Juno) 云并列出容器(桶)。
这是 Python 2.7 和 swift3 中间件 (https://github.com/stackforge/swift3)。
我使用的是管理员账户,这也是我创建它们的账户,所以这应该不是权限问题。
我可以建立 ec2 连接并列出所有图像。
我也拿不到个人桶。试图检索的那个有 1 个对象,我可以在 Openstack 仪表板中看到它,并且还列出了 python-swiftclient。
如有任何建议,我们将不胜感激!
import boto
import boto.s3.connection
from boto.s3.connection import OrdinaryCallingFormat
import logging
logging.basicConfig(filename="boto.log", level=logging.DEBUG)
A_KEY = '<access_key>'
S_KEY = '<secret_key>'
s3_conn = boto.connect_s3(
aws_access_key_id=A_KEY,
aws_secret_access_key=S_KEY,
port=8080,
host='<host>',
is_secure=False,
path='/swift/v1',
validate_certs=False,
calling_format=boto.s3.connection.OrdinaryCallingFormat())
s3_conn.get_all_buckets()
###############################################
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/macleanal/Development/cl2/lib/python2.7/site-packages/boto/s3/connection.py", line 445, in get_all_buckets
xml.sax.parseString(body, h)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/__init__.py", line 49, in parseString
parser.parse(inpsrc)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 110, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 125, in parse
self.close()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 225, in close
self.feed("", isFinal = 1)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 217, in feed
self._err_handler.fatalError(exc)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/handler.py", line 38, in fatalError
raise exception
xml.sax._exceptions.SAXParseException: <unknown>:1:0: no element found
#################################################
b = s3_conn.get_bucket('Test')
#################################################
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/macleanal/Development/cl2/lib/python2.7/site-packages/boto/s3/connection.py", line 502, in get_bucket
return self.head_bucket(bucket_name, headers=headers)
File "/Users/macleanal/Development/cl2/lib/python2.7/site-packages/boto/s3/connection.py", line 549, in head_bucket
response.status, response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 204 No Content
和日志:
Thu, 01 Oct 2015 13:43:48 GMT
/swift/v1/
DEBUG:boto:Signature:
AWS <access_key>
DEBUG:boto:Final headers: {'Date': 'Wed, 30 Sep 2015 20:46:39 GMT', 'Content-Length': '0', 'Authorization': u'AWS <access_key>', 'User-Agent': 'Boto/2.38.0 Python/2.7.10 Darwin/14.5.0'}
DEBUG:boto:Response headers: [('date', 'Wed, 30 Sep 2015 20:45:32 GMT'), ('content-type', 'text/plain; charset=utf-8'), ('server', 'Apache/2.4.7 (Ubuntu)')]
/swift/v1/Test/
DEBUG:boto:Signature:
AWS <access_key>
DEBUG:boto:Final headers: {'Date': 'Thu, 01 Oct 2015 13:43:48 GMT', 'Content-Length': '0', 'Authorization': u'AWS <access_key>', 'User-Agent': 'Boto/2.38.0 Python/2.7.10 Darwin/14.5.0'}
DEBUG:boto:Response headers: [('x-container-object-count', '1'), ('server', 'Apache/2.4.7 (Ubuntu)'), ('x-container-bytes-used-actual', '4096'), ('x-container-bytes-used', '1652'), ('x-container-read', '.r:*'), ('date', 'Thu, 01 Oct 2015 13:42:39 GMT'), ('content-type', 'text/plain; charset=utf-8')]
通过使用 Swift 对象存储重新部署我们的开发云,这不再是问题。用于对象存储的 Ceph 与 Boto S3 不够兼容 API。