On Fri, 18 Dec 2009 10:57:45 -0500
Jeff Darcy <[email protected]> wrote:
> On 12/18/2009 05:14 AM, Jeff Garzik wrote:
> > Is there anyone that would be interested in copying (or directly use)
> > /usr/lib/python2.6/site-packages/boto/tests/test_s3connection.py as a
> > tabled "boto-works" test? According to the boto author, boto should
> > accept non-Amazon hostnames, which is the only requirement outside of
> > Amazon AWS specifications that tabled has.
>
> Boto can accept non-Amazon hostnames, but there's a bit of a trick to
> making it work with tabled. As of September 10, this was the magic formula.
> >>> x =
> >>> Connection("foo","bar",host="localhost4",port=18080,is_secure=False,debug=99,calling_format=boto.s3.connection.OrdinaryCallingFormat())
> >>> x.get_all_buckets()
>
> The magic is in the calling_format part, which took a little while to
> puzzle through. We should probably consider supporting the default
> calling format to make use of boto-based tools easier.
This sounds strange on 2 counts.
1. I fixed the calling format issue long time ago. Mind that you have
to add a wildcard for it to work:
; Default port is 8081, we override it with -p 4499 in /etc/sysconfig/cld
_cld._udp IN SRV 10 50 4499 hitlain
_cld._udp IN SRV 10 50 4499 elanor
;
; Intel no-name experimental box, wildcard is for tabled
hitlain IN A 192.168.128.2
IN AAAA fec0:0:0:1:0:0:c0a8:8002
*.hitlain.zaitcev.lan. IN A 192.168.128.2
IN AAAA fec0:0:0:1:0:0:c0a8:8002
2. I see you using the port parameter, but when I tried that, Boto ignored
port and continued to use 80. The code formed a string URL without port
and then passed that to some HTTP libraries.
Since I have no clue about Python, I had trouble making their standard
testing harness to work, so I just copied the test into a local file,
and appended an invocation like this:
from boto.s3.connection import S3Connection
from boto.s3.connection import OrdinaryCallingFormat, SubdomainCallingFormat
from boto.exception import S3PermissionsError
# class S3ConnectionTest (unittest.TestCase):
class S3ConnectionTest:
def test_1_basic(self):
c = S3Connection(aws_access_key_id="testuser",
aws_secret_access_key="testpass",
is_secure=False,
host="hitlain.zaitcev.lan",
debug=1,
calling_format=SubdomainCallingFormat())
......................
t = S3ConnectionTest()
t.test_1_basic()
-- Pete
--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html