You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2011/06/05 10:37:04 UTC
svn commit: r1132068 [8/8] - in /incubator/mesos/trunk: ec2/
third_party/boto-1.9b/ third_party/boto-1.9b/bin/
third_party/boto-1.9b/boto.egg-info/ third_party/boto-1.9b/boto/
third_party/boto-1.9b/boto/cloudfront/ third_party/boto-1.9b/boto/contrib/
t...
Copied: incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_gsconnection.py (from r1132067, incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_s3connection.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_gsconnection.py?p2=incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_gsconnection.py&p1=incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_s3connection.py&r1=1132067&r2=1132068&rev=1132068&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_s3connection.py (original)
+++ incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_gsconnection.py Sun Jun 5 08:36:52 2011
@@ -1,6 +1,8 @@
#!/usr/bin/env python
-
-# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
+# -*- coding: utf-8 -*-
+# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2010, Eucalyptus Systems, Inc.
+# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
@@ -22,32 +24,26 @@
# IN THE SOFTWARE.
"""
-Some unit tests for the S3Connection
+Some unit tests for the GSConnection
"""
import unittest
import time
import os
import urllib
-from boto.s3.connection import S3Connection
+from boto.gs.connection import GSConnection
from boto.exception import S3PermissionsError
-class S3ConnectionTest (unittest.TestCase):
+class GSConnectionTest (unittest.TestCase):
def test_1_basic(self):
- print '--- running S3Connection tests ---'
- c = S3Connection()
+ print '--- running GSConnection tests ---'
+ c = GSConnection()
# create a new, empty bucket
bucket_name = 'test-%d' % int(time.time())
bucket = c.create_bucket(bucket_name)
# now try a get_bucket call and see if it's really there
bucket = c.get_bucket(bucket_name)
- # test logging
- logging_bucket = c.create_bucket(bucket_name + '-log')
- logging_bucket.set_as_logging_target()
- bucket.enable_logging(target_bucket=logging_bucket, target_prefix=bucket.name)
- bucket.disable_logging()
- c.delete_bucket(logging_bucket)
k = bucket.new_key()
k.name = 'foobar'
s1 = 'This is a test of file upload and download'
@@ -61,13 +57,6 @@ class S3ConnectionTest (unittest.TestCas
# check to make sure content read from s3 is identical to original
assert s1 == fp.read(), 'corrupted file'
fp.close()
- # test generated URLs
- url = k.generate_url(3600)
- file = urllib.urlopen(url)
- assert s1 == file.read(), 'invalid URL %s' % url
- url = k.generate_url(3600, force_http=True)
- file = urllib.urlopen(url)
- assert s1 == file.read(), 'invalid URL %s' % url
bucket.delete_key(k)
# test a few variations on get_all_keys - first load some data
# for the first one, let's override the content type
@@ -113,15 +102,23 @@ class S3ConnectionTest (unittest.TestCas
mdkey2 = 'meta2'
mdval2 = 'This is the second metadata value'
k.set_metadata(mdkey2, mdval2)
+ # try a unicode metadata value
+
+ mdval3 = u'föö'
+ mdkey3 = 'meta3'
+ k.set_metadata(mdkey3, mdval3)
k.set_contents_from_string(s1)
+
k = bucket.lookup('has_metadata')
assert k.get_metadata(mdkey1) == mdval1
assert k.get_metadata(mdkey2) == mdval2
+ assert k.get_metadata(mdkey3) == mdval3
k = bucket.new_key()
k.name = 'has_metadata'
k.get_contents_as_string()
assert k.get_metadata(mdkey1) == mdval1
assert k.get_metadata(mdkey2) == mdval2
+ assert k.get_metadata(mdkey3) == mdval3
bucket.delete_key(k)
# test list and iterator
rs1 = bucket.list()
@@ -142,28 +139,22 @@ class S3ConnectionTest (unittest.TestCas
assert len(rs) == num_keys
# try some acl stuff
bucket.set_acl('public-read')
- policy = bucket.get_acl()
- assert len(policy.acl.grants) == 2
+ acl = bucket.get_acl()
+ assert len(acl.entries.entry_list) == 2
bucket.set_acl('private')
- policy = bucket.get_acl()
- assert len(policy.acl.grants) == 1
+ acl = bucket.get_acl()
+ assert len(acl.entries.entry_list) == 1
k = bucket.lookup('foo/bar')
k.set_acl('public-read')
- policy = k.get_acl()
- assert len(policy.acl.grants) == 2
+ acl = k.get_acl()
+ assert len(acl.entries.entry_list) == 2
k.set_acl('private')
- policy = k.get_acl()
- assert len(policy.acl.grants) == 1
- # try the convenience methods for grants
- bucket.add_user_grant('FULL_CONTROL',
- 'c1e724fbfa0979a4448393c59a8c055011f739b6d102fb37a65f26414653cd67')
- try:
- bucket.add_email_grant('foobar', 'foo@bar.com')
- except S3PermissionsError:
- pass
+ acl = k.get_acl()
+ assert len(acl.entries.entry_list) == 1
# now delete all keys in bucket
- for k in all:
+ for k in bucket:
bucket.delete_key(k)
# now delete bucket
+ time.sleep(5)
c.delete_bucket(bucket)
print '--- tests completed ---'
Copied: incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_s3connection.py (from r1132067, incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_s3connection.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_s3connection.py?p2=incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_s3connection.py&p1=incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_s3connection.py&r1=1132067&r2=1132068&rev=1132068&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_s3connection.py (original)
+++ incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_s3connection.py Sun Jun 5 08:36:52 2011
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-
+# -*- coding: utf-8 -*-
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
@@ -113,15 +113,21 @@ class S3ConnectionTest (unittest.TestCas
mdkey2 = 'meta2'
mdval2 = 'This is the second metadata value'
k.set_metadata(mdkey2, mdval2)
+ # try a unicode metadata value
+ mdval3 = u'föö'
+ mdkey3 = 'meta3'
+ k.set_metadata(mdkey3, mdval3)
k.set_contents_from_string(s1)
k = bucket.lookup('has_metadata')
assert k.get_metadata(mdkey1) == mdval1
assert k.get_metadata(mdkey2) == mdval2
+ assert k.get_metadata(mdkey3) == mdval3
k = bucket.new_key()
k.name = 'has_metadata'
k.get_contents_as_string()
assert k.get_metadata(mdkey1) == mdval1
assert k.get_metadata(mdkey2) == mdval2
+ assert k.get_metadata(mdkey3) == mdval3
bucket.delete_key(k)
# test list and iterator
rs1 = bucket.list()
@@ -161,9 +167,16 @@ class S3ConnectionTest (unittest.TestCas
bucket.add_email_grant('foobar', 'foo@bar.com')
except S3PermissionsError:
pass
+ # now try to create an RRS key
+ k = bucket.new_key('reduced_redundancy')
+ k.set_contents_from_string('This key has reduced redundancy',
+ reduced_redundancy=True)
# now delete all keys in bucket
- for k in all:
+ for k in bucket:
+ if k.name == 'reduced_redundancy':
+ assert k.storage_class == 'REDUCED_REDUNDANCY'
bucket.delete_key(k)
# now delete bucket
+ time.sleep(5)
c.delete_bucket(bucket)
print '--- tests completed ---'
Added: incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_s3versioning.py
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_s3versioning.py?rev=1132068&view=auto
==============================================================================
--- incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_s3versioning.py (added)
+++ incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_s3versioning.py Sun Jun 5 08:36:52 2011
@@ -0,0 +1,149 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2010, Eucalyptus Systems, Inc.
+# All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish, dis-
+# tribute, sublicense, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the fol-
+# lowing conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+"""
+Some unit tests for the S3 Versioning and MfaDelete
+"""
+
+import unittest
+import time
+import os
+import urllib
+from boto.s3.connection import S3Connection
+from boto.exception import S3ResponseError
+from boto.s3.deletemarker import DeleteMarker
+
+class S3VersionTest (unittest.TestCase):
+
+ def test_1_versions(self):
+ print '--- running S3Version tests ---'
+ c = S3Connection()
+ # create a new, empty bucket
+ bucket_name = 'version-%d' % int(time.time())
+ bucket = c.create_bucket(bucket_name)
+
+ # now try a get_bucket call and see if it's really there
+ bucket = c.get_bucket(bucket_name)
+
+ # enable versions
+ d = bucket.get_versioning_status()
+ assert not d.has_key('Versioning')
+ bucket.configure_versioning(versioning=True)
+ time.sleep(5)
+ d = bucket.get_versioning_status()
+ assert d['Versioning'] == 'Enabled'
+
+ # create a new key in the versioned bucket
+ k = bucket.new_key()
+ k.name = 'foobar'
+ s1 = 'This is a test of s3 versioning'
+ s2 = 'This is the second test of s3 versioning'
+ k.set_contents_from_string(s1)
+ time.sleep(5)
+
+ # remember the version id of this object
+ v1 = k.version_id
+
+ # now get the contents from s3
+ o1 = k.get_contents_as_string()
+
+ # check to make sure content read from s3 is identical to original
+ assert o1 == s1
+
+ # now overwrite that same key with new data
+ k.set_contents_from_string(s2)
+ v2 = k.version_id
+ time.sleep(5)
+
+ # now retrieve the contents as a string and compare
+ s3 = k.get_contents_as_string()
+ assert s3 == s2
+
+ # Now list all versions and compare to what we have
+ rs = bucket.get_all_versions()
+ assert rs[0].version_id == v2
+ assert rs[1].version_id == v1
+
+ # Now do a regular list command and make sure only the new key shows up
+ rs = bucket.get_all_keys()
+ assert len(rs) == 1
+
+ # Now do regular delete
+ bucket.delete_key('foobar')
+ time.sleep(5)
+
+ # Now list versions and make sure old versions are there
+ # plus the DeleteMarker
+ rs = bucket.get_all_versions()
+ assert len(rs) == 3
+ assert isinstance(rs[0], DeleteMarker)
+
+ # Now delete v1 of the key
+ bucket.delete_key('foobar', version_id=v1)
+ time.sleep(5)
+
+ # Now list versions again and make sure v1 is not there
+ rs = bucket.get_all_versions()
+ versions = [k.version_id for k in rs]
+ assert v1 not in versions
+ assert v2 in versions
+
+ # Now try to enable MfaDelete
+ mfa_sn = raw_input('MFA S/N: ')
+ mfa_code = raw_input('MFA Code: ')
+ bucket.configure_versioning(True, mfa_delete=True, mfa_token=(mfa_sn, mfa_code))
+ i = 0
+ for i in range(1,8):
+ time.sleep(2**i)
+ d = bucket.get_versioning_status()
+ if d['Versioning'] == 'Enabled' and d['MfaDelete'] == 'Enabled':
+ break
+ assert d['Versioning'] == 'Enabled'
+ assert d['MfaDelete'] == 'Enabled'
+
+ # Now try to delete v2 without the MFA token
+ try:
+ bucket.delete_key('foobar', version_id=v2)
+ except S3ResponseError:
+ pass
+
+ # Now try to delete v2 with the MFA token
+ mfa_code = raw_input('MFA Code: ')
+ bucket.delete_key('foobar', version_id=v2, mfa_token=(mfa_sn, mfa_code))
+
+ # Now disable MfaDelete on the bucket
+ mfa_code = raw_input('MFA Code: ')
+ bucket.configure_versioning(True, mfa_delete=False, mfa_token=(mfa_sn, mfa_code))
+
+ # Now suspend Versioning on the bucket
+ bucket.configure_versioning(False)
+
+ # now delete all keys and deletemarkers in bucket
+ for k in bucket.list_versions():
+ bucket.delete_key(k.name, version_id=k.version_id)
+
+ # now delete bucket
+ c.delete_bucket(bucket)
+ print '--- tests completed ---'
Copied: incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_sdbconnection.py (from r1132067, incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_sdbconnection.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_sdbconnection.py?p2=incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_sdbconnection.py&p1=incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_sdbconnection.py&r1=1132067&r2=1132068&rev=1132068&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_sdbconnection.py (original)
+++ incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_sdbconnection.py Sun Jun 5 08:36:52 2011
@@ -1,6 +1,8 @@
#!/usr/bin/env python
-# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2010, Eucalyptus Systems, Inc.
+# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
@@ -67,12 +69,14 @@ class SDBConnectionTest (unittest.TestCa
assert item['name2'] == attrs_1['name2']
# try a search or two
- rs = domain.query("['name1'='%s']" % same_value)
+ query = 'select * from %s where name1="%s"' % (domain_name, same_value)
+ rs = domain.select(query)
n = 0
for item in rs:
n += 1
assert n == 2
- rs = domain.query("['name2'='diff_value_2']")
+ query = 'select * from %s where name2="diff_value_2"' % domain_name
+ rs = domain.select(query)
n = 0
for item in rs:
n += 1
Copied: incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_sqsconnection.py (from r1132067, incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_sqsconnection.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_sqsconnection.py?p2=incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_sqsconnection.py&p1=incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_sqsconnection.py&r1=1132067&r2=1132068&rev=1132068&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_sqsconnection.py (original)
+++ incubator/mesos/trunk/third_party/boto-2.0b2/boto/tests/test_sqsconnection.py Sun Jun 5 08:36:52 2011
@@ -1,6 +1,8 @@
#!/usr/bin/env python
-# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2010, Eucalyptus Systems, Inc.
+# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
@@ -85,9 +87,9 @@ class SQSConnectionTest (unittest.TestCa
message_body = 'This is a test\n'
message = queue.new_message(message_body)
queue.write(message)
- time.sleep(30)
+ time.sleep(60)
assert queue.count_slow() == 1
- time.sleep(30)
+ time.sleep(90)
# now read the message from the queue with a 10 second timeout
message = queue.read(visibility_timeout=10)
@@ -98,18 +100,11 @@ class SQSConnectionTest (unittest.TestCa
message = queue.read()
assert message == None
- # now wait 10 seconds and try again
- time.sleep(10)
+ # now wait 30 seconds and try again
+ time.sleep(30)
message = queue.read()
assert message
- if c.APIVersion == '2007-05-01':
- # now terminate the visibility timeout for this message
- message.change_visibility(0)
- # now see if we can read it in the queue
- message = queue.read()
- assert message
-
# now delete the message
queue.delete_message(message)
time.sleep(30)
Copied: incubator/mesos/trunk/third_party/boto-2.0b2/boto/utils.py (from r1132067, incubator/mesos/trunk/third_party/boto-1.9b/boto/utils.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/boto/utils.py?p2=incubator/mesos/trunk/third_party/boto-2.0b2/boto/utils.py&p1=incubator/mesos/trunk/third_party/boto-1.9b/boto/utils.py&r1=1132067&r2=1132068&rev=1132068&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.9b/boto/utils.py (original)
+++ incubator/mesos/trunk/third_party/boto-2.0b2/boto/utils.py Sun Jun 5 08:36:52 2011
@@ -1,4 +1,6 @@
-# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2010, Eucalyptus Systems, Inc.
+# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
@@ -39,10 +41,12 @@ Some handy utility functions used by sev
import base64
import hmac
import re
-import urllib, urllib2
+import urllib
+import urllib2
import imp
-import subprocess, os, StringIO
-import time, datetime
+import subprocess
+import StringIO
+import time
import logging.handlers
import boto
import tempfile
@@ -61,15 +65,16 @@ except ImportError:
import md5
_hashfn = md5.md5
-METADATA_PREFIX = 'x-amz-meta-'
-AMAZON_HEADER_PREFIX = 'x-amz-'
-
# generates the aws canonical string for the given parameters
-def canonical_string(method, path, headers, expires=None):
+def canonical_string(method, path, headers, expires=None,
+ provider=None):
+ if not provider:
+ provider = boto.provider.get_default()
interesting_headers = {}
for key in headers:
lk = key.lower()
- if lk in ['content-md5', 'content-type', 'date'] or lk.startswith(AMAZON_HEADER_PREFIX):
+ if headers[key] != None and (lk in ['content-md5', 'content-type', 'date'] or
+ lk.startswith(provider.header_prefix)):
interesting_headers[lk] = headers[key].strip()
# these keys get empty strings if they don't exist
@@ -79,11 +84,11 @@ def canonical_string(method, path, heade
interesting_headers['content-md5'] = ''
# just in case someone used this. it's not necessary in this lib.
- if interesting_headers.has_key('x-amz-date'):
+ if interesting_headers.has_key(provider.date_header):
interesting_headers['date'] = ''
# if you're using expires for query string auth, then it trumps date
- # (and x-amz-date)
+ # (and provider.date_header)
if expires:
interesting_headers['date'] = str(expires)
@@ -92,10 +97,11 @@ def canonical_string(method, path, heade
buf = "%s\n" % method
for key in sorted_header_keys:
- if key.startswith(AMAZON_HEADER_PREFIX):
- buf += "%s:%s\n" % (key, interesting_headers[key])
+ val = interesting_headers[key]
+ if key.startswith(provider.header_prefix):
+ buf += "%s:%s\n" % (key, val)
else:
- buf += "%s\n" % interesting_headers[key]
+ buf += "%s\n" % val
# don't include anything after the first ? in the resource...
buf += "%s" % path.split('?')[0]
@@ -111,10 +117,21 @@ def canonical_string(method, path, heade
buf += "?location"
elif re.search("[&?]requestPayment($|=|&)", path):
buf += "?requestPayment"
+ elif re.search("[&?]versions($|=|&)", path):
+ buf += "?versions"
+ elif re.search("[&?]versioning($|=|&)", path):
+ buf += "?versioning"
+ else:
+ m = re.search("[&?]versionId=([^&]+)($|=|&)", path)
+ if m:
+ buf += '?versionId=' + m.group(1)
return buf
-def merge_meta(headers, metadata):
+def merge_meta(headers, metadata, provider=None):
+ if not provider:
+ provider = boto.provider.get_default()
+ metadata_prefix = provider.metadata_prefix
final_headers = headers.copy()
for k in metadata.keys():
if k.lower() in ['cache-control', 'content-md5', 'content-type',
@@ -122,15 +139,19 @@ def merge_meta(headers, metadata):
'date', 'expires']:
final_headers[k] = metadata[k]
else:
- final_headers[METADATA_PREFIX + k] = metadata[k]
+ final_headers[metadata_prefix + k] = metadata[k]
return final_headers
-def get_aws_metadata(headers):
+def get_aws_metadata(headers, provider=None):
+ if not provider:
+ provider = boto.provider.get_default()
+ metadata_prefix = provider.metadata_prefix
metadata = {}
for hkey in headers.keys():
- if hkey.lower().startswith(METADATA_PREFIX):
- metadata[hkey[len(METADATA_PREFIX):]] = headers[hkey]
+ if hkey.lower().startswith(metadata_prefix):
+ val = urllib.unquote_plus(headers[hkey])
+ metadata[hkey[len(metadata_prefix):]] = unicode(val, 'utf-8')
del headers[hkey]
return metadata
@@ -214,7 +235,6 @@ def find_class(module_name, class_name=N
if class_name:
module_name = "%s.%s" % (module_name, class_name)
modules = module_name.split('.')
- path = None
c = None
try:
@@ -247,7 +267,6 @@ def fetch_file(uri, file=None, username=
if file == None:
file = tempfile.NamedTemporaryFile()
try:
- working_dir = boto.config.get("General", "working_dir")
if uri.startswith('s3://'):
bucket_name, key_name = uri[len('s3://'):].split('/', 1)
c = boto.connect_s3()
@@ -340,11 +359,6 @@ class AuthSMTPHandler(logging.handlers.S
without having to resort to cut and paste inheritance but, no.
"""
try:
- import smtplib
- try:
- from email.Utils import formatdate
- except:
- formatdate = self.date_time
port = self.mailport
if not port:
port = smtplib.SMTP_PORT
@@ -353,7 +367,7 @@ class AuthSMTPHandler(logging.handlers.S
msg = self.format(record)
msg = "From: %s\r\nTo: %s\r\nSubject: %s\r\nDate: %s\r\n\r\n%s" % (
self.fromaddr,
- string.join(self.toaddrs, ","),
+ ','.join(self.toaddrs),
self.getSubject(record),
formatdate(), msg)
smtp.sendmail(self.fromaddr, self.toaddrs, msg)
@@ -460,7 +474,6 @@ class LRUCache(dict):
def _manage_size(self):
while len(self._dict) > self.capacity:
- olditem = self._dict[self.tail.key]
del self._dict[self.tail.key]
if self.tail != self.head:
self.tail = self.tail.previous
@@ -520,6 +533,7 @@ def notify(subject, body=None, html_body
from_string = boto.config.get_value('Notification', 'smtp_from', 'boto')
msg = MIMEMultipart()
msg['From'] = from_string
+ msg['Reply-To'] = from_string
msg['To'] = to_string
msg['Date'] = formatdate(localtime=True)
msg['Subject'] = subject
Copied: incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/__init__.py (from r1132067, incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/__init__.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/__init__.py?p2=incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/__init__.py&p1=incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/__init__.py&r1=1132067&r2=1132068&rev=1132068&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/__init__.py (original)
+++ incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/__init__.py Sun Jun 5 08:36:52 2011
@@ -23,12 +23,7 @@
Represents a connection to the EC2 service.
"""
-import urllib
-import base64
-import boto
-from boto import config
from boto.ec2.connection import EC2Connection
-from boto.resultset import ResultSet
from boto.vpc.vpc import VPC
from boto.vpc.customergateway import CustomerGateway
from boto.vpc.vpngateway import VpnGateway, Attachment
@@ -381,7 +376,7 @@ class VPCConnection(EC2Connection):
:rtype: bool
:return: True if successful
"""
- params = {'DhcpOptionsId': subnet_id}
+ params = {'DhcpOptionsId': dhcp_options_id}
return self.get_status('DeleteDhcpOptions', params)
def associate_dhcp_options(self, dhcp_options_id, vpc_id):
@@ -397,7 +392,7 @@ class VPCConnection(EC2Connection):
:rtype: bool
:return: True if successful
"""
- params = {'DhcpOptionsId': dhcp_option,
+ params = {'DhcpOptionsId': dhcp_options_id,
'VpcId' : vpc_id}
return self.get_status('AssociateDhcpOptions', params)
@@ -438,7 +433,7 @@ class VPCConnection(EC2Connection):
params[('Filter.%d.Key' % i)] = filter[0]
params[('Filter.%d.Value.1')] = filter[1]
i += 1
- return self.get_list('DescribeVpnConnections', params, [('item', VPNConnection)])
+ return self.get_list('DescribeVpnConnections', params, [('item', VpnConnection)])
def create_vpn_connection(self, type, customer_gateway_id, vpn_gateway_id):
"""
Copied: incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/customergateway.py (from r1132067, incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/customergateway.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/customergateway.py?p2=incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/customergateway.py&p1=incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/customergateway.py&r1=1132067&r2=1132068&rev=1132068&view=diff
==============================================================================
(empty)
Copied: incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/dhcpoptions.py (from r1132067, incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/dhcpoptions.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/dhcpoptions.py?p2=incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/dhcpoptions.py&p1=incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/dhcpoptions.py&r1=1132067&r2=1132068&rev=1132068&view=diff
==============================================================================
(empty)
Copied: incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/subnet.py (from r1132067, incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/subnet.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/subnet.py?p2=incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/subnet.py&p1=incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/subnet.py&r1=1132067&r2=1132068&rev=1132068&view=diff
==============================================================================
(empty)
Copied: incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/vpc.py (from r1132067, incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpc.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/vpc.py?p2=incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/vpc.py&p1=incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpc.py&r1=1132067&r2=1132068&rev=1132068&view=diff
==============================================================================
(empty)
Copied: incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/vpnconnection.py (from r1132067, incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpnconnection.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/vpnconnection.py?p2=incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/vpnconnection.py&p1=incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpnconnection.py&r1=1132067&r2=1132068&rev=1132068&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpnconnection.py (original)
+++ incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/vpnconnection.py Sun Jun 5 08:36:52 2011
@@ -34,7 +34,7 @@ class VpnConnection(EC2Object):
self.customer_gateway_configuration = None
self.type = None
self.customer_gateway_id = None
- self.vpn_gateway_id = Nonen
+ self.vpn_gateway_id = None
def __repr__(self):
return 'VpnConnection:%s' % self.id
Copied: incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/vpngateway.py (from r1132067, incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpngateway.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/vpngateway.py?p2=incubator/mesos/trunk/third_party/boto-2.0b2/boto/vpc/vpngateway.py&p1=incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpngateway.py&r1=1132067&r2=1132068&rev=1132068&view=diff
==============================================================================
(empty)
Copied: incubator/mesos/trunk/third_party/boto-2.0b2/setup.cfg (from r1132067, incubator/mesos/trunk/third_party/boto-1.9b/setup.cfg)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/setup.cfg?p2=incubator/mesos/trunk/third_party/boto-2.0b2/setup.cfg&p1=incubator/mesos/trunk/third_party/boto-1.9b/setup.cfg&r1=1132067&r2=1132068&rev=1132068&view=diff
==============================================================================
(empty)
Copied: incubator/mesos/trunk/third_party/boto-2.0b2/setup.py (from r1132067, incubator/mesos/trunk/third_party/boto-1.9b/setup.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-2.0b2/setup.py?p2=incubator/mesos/trunk/third_party/boto-2.0b2/setup.py&p1=incubator/mesos/trunk/third_party/boto-1.9b/setup.py&r1=1132067&r2=1132068&rev=1132068&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.9b/setup.py (original)
+++ incubator/mesos/trunk/third_party/boto-2.0b2/setup.py Sun Jun 5 08:36:52 2011
@@ -1,6 +1,8 @@
#!/usr/bin/python
-# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2010, Eucalyptus Systems, Inc.
+# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
@@ -34,17 +36,20 @@ setup(name = "boto",
long_description="Python interface to Amazon's Web Services.",
author = "Mitch Garnaat",
author_email = "mitch@garnaat.com",
- scripts = ["bin/sdbadmin", "bin/elbadmin", "bin/s3put", "bin/fetch_file", "bin/launch_instance", 'bin/list_instances', "bin/taskadmin"],
+ scripts = ["bin/sdbadmin", "bin/elbadmin", "bin/cfadmin",
+ "bin/s3put", "bin/fetch_file", "bin/launch_instance",
+ "bin/list_instances", "bin/taskadmin", "bin/kill_instance",
+ "bin/bundle_image", "bin/pyami_sendmail"],
url = "http://code.google.com/p/boto/",
- packages = [ 'boto', 'boto.sqs', 'boto.s3',
+ packages = [ 'boto', 'boto.sqs', 'boto.s3', 'boto.gs', 'boto.file',
'boto.ec2', 'boto.ec2.cloudwatch', 'boto.ec2.autoscale', 'boto.ec2.elb',
'boto.sdb', 'boto.sdb.persist', 'boto.sdb.db', 'boto.sdb.db.manager',
'boto.mturk', 'boto.pyami', 'boto.mashups', 'boto.contrib', 'boto.manage',
'boto.services', 'boto.tests', 'boto.cloudfront', 'boto.rds', 'boto.vpc',
- 'boto.fps'],
+ 'boto.fps', 'boto.emr', 'boto.sns'],
license = 'MIT',
platforms = 'Posix; MacOS X; Windows',
- classifiers = [ 'Development Status :: 3 - Alpha',
+ classifiers = [ 'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',