问题:
我试图调试一些使用Softlayer Object Storage的代码但是我一直在从SL本身得到一些错误。由于我从SL得到错误,我继续尝试编写一些重现错误的代码。下面可以看到我得到的堆栈跟踪。
问题:
有没有人知道为什么除了可以防止多次发送垃圾邮件的安全措施之外我还会收到以下错误?
源代码:
#!/usr/local/bin/python2.7
import argparse
import object_storage
def main():
parser = argparse.ArgumentParser(description='Spam multiple sl storage containers.')
parser.add_argument("--username", type=str, required=True, help="softlayer username")
parser.add_argument("--apikey", type=str, required=True, help="softlayer api key")
parser.add_argument("--datacenter", type=str, required=True, help="softlayer datacenter")
parser.add_argument("--count", type=int, required=True, help="Amount of times to iterate")
args = parser.parse_args()
username = args.username
api_key = args.apikey
datacenter = args.datacenter
count = args.count
for i in range(0, count):
print "Trying to create sl_storage.containers() #{0}".format(i)
sl_storage = object_storage.get_client(username, api_key, datacenter=datacenter)
containers = sl_storage.containers()
del containers
del sl_storage
if __name__ == "__main__":
main()
堆栈追踪:
Traceback (most recent call last):
File "/root/sl_test.py", line 32, in <module>
main()
File "/root/sl_test.py", line 27, in main
containers = sl_storage.containers()
File "/usr/local/lib/python2.7/site-packages/object_storage/client.py", line 293, in containers
formatter=_formatter)
File "/usr/local/lib/python2.7/site-packages/object_storage/client.py", line 354, in make_request
result = self.conn.make_request(method, url, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/object_storage/transport/httplib2conn.py", line 55, in make_request
response = _make_request(headers)
File "/usr/local/lib/python2.7/site-packages/object_storage/transport/httplib2conn.py", line 48, in _make_request
body=data)
File "/usr/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1659, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1399, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/usr/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1325, in _conn_request
raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
httplib2.ServerNotFoundError: Unable to find the server at dal05.objectstorage.softlayer.net
在https://github.com/softlayer/softlayer-object-storage-python/issues/50
打开了针对softlayer-object_storage
python包的问题
答案 0 :(得分:0)
首先:我认为你应该在这里打开这个问题:
https://github.com/softlayer/softlayer-object-storage-python
第二:我认为这对我来说不是一个问题,这是正常的,错误可能是由于你在dal05中没有任何存储,你可以通过https://control.softlayer.com/storage/objectstorage来验证控制门户中的存储并确保dal05中有容器。
第三:您使用的客户端仅适用于快速存储,它不适用于S3容器
答案 1 :(得分:0)
此问题中的存储是基于Swift而不是S3。