mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1132067 [8/9] - in /incubator/mesos/trunk: ec2/ third_party/boto-1.8d/ third_party/boto-1.8d/bin/ third_party/boto-1.8d/boto.egg-info/ third_party/boto-1.8d/boto/ third_party/boto-1.8d/boto/cloudfront/ third_party/boto-1.8d/boto/contrib/ t...
Date Sun, 05 Jun 2011 08:34:13 GMT
Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/connection.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/connection.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/connection.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/connection.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/connection.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/connection.py (original)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/connection.py Sun Jun  5 08:34:02 2011
@@ -55,21 +55,21 @@ class SQSConnection(AWSQueryConnection):
         """
         Create an SQS Queue.
 
-        @type queue_name: str or unicode
-        @param queue_name: The name of the new queue.  Names are scoped to an account and need to
+        :type queue_name: str or unicode
+        :param queue_name: The name of the new queue.  Names are scoped to an account and need to
                            be unique within that account.  Calling this method on an existing
                            queue name will not return an error from SQS unless the value for
                            visibility_timeout is different than the value of the existing queue
                            of that name.  This is still an expensive operation, though, and not
                            the preferred way to check for the existence of a queue.  See the
-                           L{lookup<boto.sqs.connection.SQSConnection.lookup>} method.
+                           :func:`boto.sqs.connection.SQSConnection.lookup` method.
 
-        @type visibility_timeout: int
-        @param visibility_timeout: The default visibility timeout for all messages written in the
+        :type visibility_timeout: int
+        :param visibility_timeout: The default visibility timeout for all messages written in the
                                    queue.  This can be overridden on a per-message.
 
-        @rtype: L{Queue<boto.sqs.queue.Queue>}
-        @return: The newly created queue.
+        :rtype: :class:`boto.sqs.queue.Queue`
+        :return: The newly created queue.
 
         """
         params = {'QueueName': queue_name}
@@ -81,18 +81,18 @@ class SQSConnection(AWSQueryConnection):
         """
         Delete an SQS Queue.
 
-        @type queue: A Queue object
-        @param queue: The SQS queue to be deleted
+        :type queue: A Queue object
+        :param queue: The SQS queue to be deleted
         
-        @type force_deletion: Boolean
-        @param force_deletion: Normally, SQS will not delete a queue that contains messages.
+        :type force_deletion: Boolean
+        :param force_deletion: Normally, SQS will not delete a queue that contains messages.
                                However, if the force_deletion argument is True, the
                                queue will be deleted regardless of whether there are messages in
                                the queue or not.  USE WITH CAUTION.  This will delete all
                                messages in the queue as well.
                                
-        @rtype: bool
-        @return: True if the command succeeded, False otherwise
+        :rtype: bool
+        :return: True if the command succeeded, False otherwise
         """
         return self.get_status('DeleteQueue', None, queue.id)
 
@@ -100,17 +100,21 @@ class SQSConnection(AWSQueryConnection):
         """
         Gets one or all attributes of a Queue
         
-        @type queue: A Queue object
-        @param queue: The SQS queue to be deleted
+        :type queue: A Queue object
+        :param queue: The SQS queue to be deleted
 
-        @type attribute: str
-        @type attribute: The specific attribute requested.  If not supplied, the default
+        :type attribute: str
+        :type attribute: The specific attribute requested.  If not supplied, the default
                          is to return all attributes.  Valid attributes are:
-                         ApproximateNumberOfMessages, VisibilityTimeout, CreatedTimestamp,
-                         LastModifiedTimestamp, Policy.
+                         ApproximateNumberOfMessages,
+                         ApproximateNumberOfMessagesNotVisible,
+                         VisibilityTimeout,
+                         CreatedTimestamp,
+                         LastModifiedTimestamp,
+                         Policy
                          
-        @rtype: L{Attributes<boto.sqs.attributes.Attributes>}
-        @return: An Attributes object containing request value(s).
+        :rtype: :class:`boto.sqs.attributes.Attributes`
+        :return: An Attributes object containing request value(s).
         """
         params = {'AttributeName' : attribute}
         return self.get_object('GetQueueAttributes', params, Attributes, queue.id)
@@ -124,19 +128,24 @@ class SQSConnection(AWSQueryConnection):
         """
         Read messages from an SQS Queue.
 
-        @type queue: A Queue object
-        @param queue: The Queue from which messages are read.
+        :type queue: A Queue object
+        :param queue: The Queue from which messages are read.
         
-        @type number_messages: int
-        @param number_messages: The maximum number of messages to read (default=1)
+        :type number_messages: int
+        :param number_messages: The maximum number of messages to read (default=1)
         
-        @type visibility_timeout: int
-        @param visibility_timeout: The number of seconds the message should remain invisible
+        :type visibility_timeout: int
+        :param visibility_timeout: The number of seconds the message should remain invisible
                                    to other queue readers (default=None which uses the Queues default)
 
-        @type attributes: list of strings
-        @param attributes: A list of additional attributes that will be returned
-                           with the response.  Valid values: SenderId | SentTimestamp.
+        :type attributes: list of strings
+        :param attributes: A list of additional attributes that will be returned
+                           with the response.  Valid values:
+                           All
+                           SenderId
+                           SentTimestamp
+                           ApproximateReceiveCount
+                           ApproximateFirstReceiveTimestamp
         
         """
         params = {'MaxNumberOfMessages' : number_messages}
@@ -153,22 +162,22 @@ class SQSConnection(AWSQueryConnection):
 
     def send_message(self, queue, message_content):
         params = {'MessageBody' : message_content}
-        return self.get_object('SendMessage', params, Message, queue.id)
+        return self.get_object('SendMessage', params, Message, queue.id, verb='POST')
 
     def change_message_visibility(self, queue, receipt_handle, visibility_timeout):
         """
         Extends the read lock timeout for the specified message from the specified queue
         to the specified value.
 
-        @type queue: A L{Queue<boto.sqs.queue.Queue>} object
-        @param queue: The Queue from which messages are read.
+        :type queue: A :class:`boto.sqs.queue.Queue` object
+        :param queue: The Queue from which messages are read.
         
-        @type receipt_handle: str
-        @param queue: The receipt handle associated with the message whose
+        :type receipt_handle: str
+        :param queue: The receipt handle associated with the message whose
                       visibility timeout will be changed.
         
-        @type visibility_timeout: int
-        @param visibility_timeout: The new value of the message's visibility timeout
+        :type visibility_timeout: int
+        :param visibility_timeout: The new value of the message's visibility timeout
                                    in seconds.
         """
         params = {'ReceiptHandle' : receipt_handle,
@@ -198,27 +207,27 @@ class SQSConnection(AWSQueryConnection):
         """
         Add a permission to a queue.
 
-        @type queue: L{Queue<boto.sqs.queue.Queue>}
-        @param queue: The queue object
+        :type queue: :class:`boto.sqs.queue.Queue`
+        :param queue: The queue object
 
-        @type label: str or unicode
-        @param label: A unique identification of the permission you are setting.
-                      Maximum of 80 characters [0-9a-zA-Z_-]
+        :type label: str or unicode
+        :param label: A unique identification of the permission you are setting.
+                      Maximum of 80 characters ``[0-9a-zA-Z_-]``
                       Example, AliceSendMessage
 
-        @type aws_account_id: str or unicode
-        @param principal_id: The AWS account number of the principal who will be given
+        :type aws_account_id: str or unicode
+        :param principal_id: The AWS account number of the principal who will be given
                              permission.  The principal must have an AWS account, but
                              does not need to be signed up for Amazon SQS. For information
                              about locating the AWS account identification.
 
-        @type action_name: str or unicode
-        @param action_name: The action.  Valid choices are:
-                            *|SendMessage|ReceiveMessage|DeleteMessage|
+        :type action_name: str or unicode
+        :param action_name: The action.  Valid choices are:
+                            \*|SendMessage|ReceiveMessage|DeleteMessage|
                             ChangeMessageVisibility|GetQueueAttributes
 
-        @rtype: bool
-        @return: True if successful, False otherwise.
+        :rtype: bool
+        :return: True if successful, False otherwise.
 
         """
         params = {'Label': label,
@@ -230,14 +239,14 @@ class SQSConnection(AWSQueryConnection):
         """
         Remove a permission from a queue.
 
-        @type queue: L{Queue<boto.sqs.queue.Queue>}
-        @param queue: The queue object
+        :type queue: :class:`boto.sqs.queue.Queue`
+        :param queue: The queue object
 
-        @type label: str or unicode
-        @param label: The unique label associated with the permission being removed.
+        :type label: str or unicode
+        :param label: The unique label associated with the permission being removed.
 
-        @rtype: bool
-        @return: True if successful, False otherwise.
+        :rtype: bool
+        :return: True if successful, False otherwise.
         """
         params = {'Label': label}
         return self.get_status('RemovePermission', params, queue.id)

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/jsonmessage.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/jsonmessage.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/jsonmessage.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/jsonmessage.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/jsonmessage.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/jsonmessage.py (original)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/jsonmessage.py Sun Jun  5 08:34:02 2011
@@ -20,6 +20,7 @@
 # IN THE SOFTWARE.
 
 from boto.sqs.message import MHMessage
+from boto.exception import SQSDecodeError
 import base64
 import simplejson
 
@@ -29,8 +30,12 @@ class JSONMessage(MHMessage):
     """
 
     def decode(self, value):
-        value = base64.b64decode(value)
-        return simplejson.loads(value)
+        try:
+            value = base64.b64decode(value)
+            value = simplejson.loads(value)
+        except:
+            raise SQSDecodeError('Unable to decode message', self)
+        return value
 
     def encode(self, value):
         value = simplejson.dumps(value)

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/message.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/message.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/message.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/message.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/message.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/message.py (original)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/message.py Sun Jun  5 08:34:02 2011
@@ -66,6 +66,7 @@ in the format in which it would be store
 import base64
 import StringIO
 from boto.sqs.attributes import Attributes
+from boto.exception import SQSDecodeError
 
 class RawMessage:
     """
@@ -152,7 +153,11 @@ class Message(RawMessage):
         return base64.b64encode(value)
 
     def decode(self, value):
-        return base64.b64decode(value)
+        try:
+            value = base64.b64decode(value)
+        except:
+            raise SQSDecodeError('Unable to decode message', self)
+        return value
 
 class MHMessage(Message):
     """
@@ -172,15 +177,18 @@ class MHMessage(Message):
         Message.__init__(self, queue, body)
 
     def decode(self, value):
-        msg = {}
-        fp = StringIO.StringIO(value)
-        line = fp.readline()
-        while line:
-            delim = line.find(':')
-            key = line[0:delim]
-            value = line[delim+1:].strip()
-            msg[key.strip()] = value.strip()
+        try:
+            msg = {}
+            fp = StringIO.StringIO(value)
             line = fp.readline()
+            while line:
+                delim = line.find(':')
+                key = line[0:delim]
+                value = line[delim+1:].strip()
+                msg[key.strip()] = value.strip()
+                line = fp.readline()
+        except:
+            raise SQSDecodeError('Unable to decode message', self)
         return msg
 
     def encode(self, value):
@@ -231,7 +239,10 @@ class EncodedMHMessage(MHMessage):
     """
 
     def decode(self, value):
-        value = base64.b64decode(value)
+        try:
+            value = base64.b64decode(value)
+        except:
+            raise SQSDecodeError('Unable to decode message', self)
         return MHMessage.decode(self, value)
 
     def encode(self, value):

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/queue.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/queue.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/queue.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/queue.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/queue.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/queue.py (original)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/queue.py Sun Jun  5 08:34:02 2011
@@ -31,7 +31,7 @@ from boto.sqs.message import Message
 from boto.resultset import ResultSet
 
 class Queue:
-    
+
     def __init__(self, connection=None, url=None, message_class=Message):
         self.connection = connection
         self.url = url
@@ -71,8 +71,8 @@ class Queue:
         from the queue.  By default, the class boto.sqs.message.Message is used but
         this can be overriden with any class that behaves like a message.
 
-        @type message_class: Message-like class
-        @param message_class:  The new Message class
+        :type message_class: Message-like class
+        :param message_class:  The new Message class
         """
         self.message_class = message_class
 
@@ -81,12 +81,16 @@ class Queue:
         Retrieves attributes about this queue object and returns
         them in an Attribute instance (subclass of a Dictionary).
 
-        @type attributes: string
-        @param attributes: String containing one of:
-                           ApproximateNumberOfMessages, VisibilityTimeout, CreatedTimestamp,
-                           LastModifiedTimestamp, Policy.
-        @rtype: Attribute object
-        @return: An Attribute object which is a mapping type holding the
+        :type attributes: string
+        :param attributes: String containing one of:
+                           ApproximateNumberOfMessages,
+                           ApproximateNumberOfMessagesNotVisible,
+                           VisibilityTimeout,
+                           CreatedTimestamp,
+                           LastModifiedTimestamp,
+                           Policy
+        :rtype: Attribute object
+        :return: An Attribute object which is a mapping type holding the
                  requested name/value pairs
         """
         return self.connection.get_queue_attributes(self, attributes)
@@ -95,16 +99,16 @@ class Queue:
         """
         Set a new value for an attribute of the Queue.
         
-        @type attribute: String
-        @param attribute: The name of the attribute you want to set.  The
+        :type attribute: String
+        :param attribute: The name of the attribute you want to set.  The
                            only valid value at this time is: VisibilityTimeout
-        @type value: int
-        @param value: The new value for the attribute.
+        :type value: int
+        :param value: The new value for the attribute.
                       For VisibilityTimeout the value must be an
                       integer number of seconds from 0 to 86400.
 
-        @rtype: bool
-        @return: True if successful, otherwise False.
+        :rtype: bool
+        :return: True if successful, otherwise False.
         """
         return self.connection.set_queue_attribute(self, attribute, value)
 
@@ -112,8 +116,8 @@ class Queue:
         """
         Get the visibility timeout for the queue.
         
-        @rtype: int
-        @return: The number of seconds as an integer.
+        :rtype: int
+        :return: The number of seconds as an integer.
         """
         a = self.get_attributes('VisibilityTimeout')
         return int(a['VisibilityTimeout'])
@@ -122,8 +126,8 @@ class Queue:
         """
         Set the visibility timeout for the queue.
 
-        @type visibility_timeout: int
-        @param visibility_timeout: The desired timeout in seconds
+        :type visibility_timeout: int
+        :param visibility_timeout: The desired timeout in seconds
         """
         retval = self.set_attribute('VisibilityTimeout', visibility_timeout)
         if retval:
@@ -134,24 +138,24 @@ class Queue:
         """
         Add a permission to a queue.
 
-        @type label: str or unicode
-        @param label: A unique identification of the permission you are setting.
-                      Maximum of 80 characters [0-9a-zA-Z_-]
+        :type label: str or unicode
+        :param label: A unique identification of the permission you are setting.
+                      Maximum of 80 characters ``[0-9a-zA-Z_-]``
                       Example, AliceSendMessage
 
-        @type aws_account_id: str or unicode
-        @param principal_id: The AWS account number of the principal who will be given
+        :type aws_account_id: str or unicode
+        :param principal_id: The AWS account number of the principal who will be given
                              permission.  The principal must have an AWS account, but
                              does not need to be signed up for Amazon SQS. For information
                              about locating the AWS account identification.
 
-        @type action_name: str or unicode
-        @param action_name: The action.  Valid choices are:
-                            *|SendMessage|ReceiveMessage|DeleteMessage|
+        :type action_name: str or unicode
+        :param action_name: The action.  Valid choices are:
+                            \*|SendMessage|ReceiveMessage|DeleteMessage|
                             ChangeMessageVisibility|GetQueueAttributes
 
-        @rtype: bool
-        @return: True if successful, False otherwise.
+        :rtype: bool
+        :return: True if successful, False otherwise.
 
         """
         return self.connection.add_permission(self, label, aws_account_id, action_name)
@@ -160,11 +164,11 @@ class Queue:
         """
         Remove a permission from a queue.
 
-        @type label: str or unicode
-        @param label: The unique label associated with the permission being removed.
+        :type label: str or unicode
+        :param label: The unique label associated with the permission being removed.
 
-        @rtype: bool
-        @return: True if successful, False otherwise.
+        :rtype: bool
+        :return: True if successful, False otherwise.
         """
         return self.connection.remove_permission(self, label)
     
@@ -172,11 +176,11 @@ class Queue:
         """
         Read a single message from the queue.
         
-        @type visibility_timeout: int
-        @param visibility_timeout: The timeout for this message in seconds
+        :type visibility_timeout: int
+        :param visibility_timeout: The timeout for this message in seconds
 
-        @rtype: Message
-        @return: A single message or None if queue is empty
+        :rtype: :class:`boto.sqs.message.Message`
+        :return: A single message or None if queue is empty
         """
         rs = self.get_messages(1, visibility_timeout)
         if len(rs) == 1:
@@ -188,11 +192,11 @@ class Queue:
         """
         Add a single message to the queue.
 
-        @type message: Message
-        @param message: The message to be written to the queue
+        :type message: Message
+        :param message: The message to be written to the queue
 
-        @rtype: bool
-        @return: True if successful, False if not
+        :rtype: :class:`boto.sqs.message.Message`
+        :return: The :class:`boto.sqs.message.Message` object that was written.
         """
         new_msg = self.connection.send_message(self, message.get_body_encoded())
         message.id = new_msg.id
@@ -203,41 +207,52 @@ class Queue:
         """
         Create new message of appropriate class.
 
-        @type body: message body
-        @param body: The body of the newly created message (optional).
+        :type body: message body
+        :param body: The body of the newly created message (optional).
 
-        @rtype: Message
-        @return: A new Message object
+        :rtype: :class:`boto.sqs.message.Message`
+        :return: A new Message object
         """
         m = self.message_class(self, body)
         m.queue = self
         return m
 
     # get a variable number of messages, returns a list of messages
-    def get_messages(self, num_messages=1, visibility_timeout=None):
+    def get_messages(self, num_messages=1, visibility_timeout=None,
+                     attributes=None):
         """
         Get a variable number of messages.
 
-        @type num_messages: int
-        @param num_messages: The maximum number of messages to read from the queue.
-        @type visibility_timeout: int
-        @param visibility_timeout: The VisibilityTimeout for the messages read.
+        :type num_messages: int
+        :param num_messages: The maximum number of messages to read from the queue.
+        
+        :type visibility_timeout: int
+        :param visibility_timeout: The VisibilityTimeout for the messages read.
 
-        @rtype: list
-        @return: A list of messages.
+        :type attributes: list of strings
+        :param attributes: A list of additional attributes that will be returned
+                           with the response.  Valid values:
+                           All
+                           SenderId
+                           SentTimestamp
+                           ApproximateReceiveCount
+                           ApproximateFirstReceiveTimestamp
+        :rtype: list
+        :return: A list of :class:`boto.sqs.message.Message` objects.
         """
         return self.connection.receive_message(self, number_messages=num_messages,
-                                               visibility_timeout=visibility_timeout)
+                                               visibility_timeout=visibility_timeout,
+                                               attributes=attributes)
 
     def delete_message(self, message):
         """
         Delete a message from the queue.
 
-        @type message: Message
-        @param message: The message object to delete.
+        :type message: :class:`boto.sqs.message.Message`
+        :param message: The :class:`boto.sqs.message.Message` object to delete.
 
-        @rtype: bool
-        @return: True if successful, False otherwise
+        :rtype: bool
+        :return: True if successful, False otherwise
         """
         return self.connection.delete_message(self, message)
 
@@ -338,8 +353,10 @@ class Queue:
     def save_to_s3(self, bucket):
         """
         Read all messages from the queue and persist them to S3.
-        Messages are stored in the S3 bucket using a naming scheme of:
+        Messages are stored in the S3 bucket using a naming scheme of::
+        
             <queue_id>/<message_id>
+        
         Messages are deleted from the queue after being saved to S3.
         Returns the number of messages saved.
         """
@@ -361,7 +378,7 @@ class Queue:
         if prefix:
             prefix = '%s/' % prefix
         else:
-            prefix = '%s/' % self.id
+            prefix = '%s/' % self.id[1:]
         rs = bucket.list(prefix=prefix)
         for key in rs:
             n += 1

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/regioninfo.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/regioninfo.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/regioninfo.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/regioninfo.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/regioninfo.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.8d/boto/sqs/regioninfo.py (original)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/sqs/regioninfo.py Sun Jun  5 08:34:02 2011
@@ -32,8 +32,8 @@ class SQSRegionInfo(RegionInfo):
         object's constructor as keyword arguments and they will be
         passed along to the SQSConnection object.
         
-        @rtype: L{SQSConnection<boto.sqs.connection.SQSConnection}
-        @return: The connection to this regions endpoint
+        :rtype: :class:`boto.sqs.connection.SQSConnection`
+        :return: The connection to this regions endpoint
         """
         from boto.sqs.connection import SQSConnection
         return SQSConnection(region=self, **kw_params)

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/__init__.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/services/__init__.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/__init__.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/__init__.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/services/__init__.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
    (empty)

Added: incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/devpay_s3.py
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/devpay_s3.py?rev=1132067&view=auto
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/devpay_s3.py (added)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/devpay_s3.py Sun Jun  5 08:34:02 2011
@@ -0,0 +1,177 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
+#
+# 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 S3Connection
+"""
+
+import time
+import os
+import urllib
+
+from boto.s3.connection import S3Connection
+from boto.exception import S3PermissionsError
+
+# this test requires a devpay product and user token to run:
+
+AMAZON_USER_TOKEN = '{UserToken}...your token here...'
+DEVPAY_HEADERS = { 'x-amz-security-token': AMAZON_USER_TOKEN }
+
+print '--- running S3Connection tests (DevPay) ---'
+c = S3Connection()
+# create a new, empty bucket
+bucket_name = 'test-%d' % int(time.time())
+bucket = c.create_bucket(bucket_name, headers=DEVPAY_HEADERS)
+# now try a get_bucket call and see if it's really there
+bucket = c.get_bucket(bucket_name, headers=DEVPAY_HEADERS)
+# test logging
+logging_bucket = c.create_bucket(bucket_name + '-log', headers=DEVPAY_HEADERS)
+logging_bucket.set_as_logging_target(headers=DEVPAY_HEADERS)
+bucket.enable_logging(target_bucket=logging_bucket, target_prefix=bucket.name, headers=DEVPAY_HEADERS)
+bucket.disable_logging(headers=DEVPAY_HEADERS)
+c.delete_bucket(logging_bucket, headers=DEVPAY_HEADERS)
+# create a new key and store it's content from a string
+k = bucket.new_key()
+k.name = 'foobar'
+s1 = 'This is a test of file upload and download'
+s2 = 'This is a second string to test file upload and download'
+k.set_contents_from_string(s1, headers=DEVPAY_HEADERS)
+fp = open('foobar', 'wb')
+# now get the contents from s3 to a local file
+k.get_contents_to_file(fp, headers=DEVPAY_HEADERS)
+fp.close()
+fp = open('foobar')
+# 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, headers=DEVPAY_HEADERS)
+file = urllib.urlopen(url)
+assert s1 == file.read(), 'invalid URL %s' % url
+url = k.generate_url(3600, force_http=True, headers=DEVPAY_HEADERS)
+file = urllib.urlopen(url)
+assert s1 == file.read(), 'invalid URL %s' % url
+bucket.delete_key(k, headers=DEVPAY_HEADERS)
+# test a few variations on get_all_keys - first load some data
+# for the first one, let's override the content type
+phony_mimetype = 'application/x-boto-test'
+headers = {'Content-Type': phony_mimetype}
+headers.update(DEVPAY_HEADERS)
+k.name = 'foo/bar'
+k.set_contents_from_string(s1, headers)
+k.name = 'foo/bas'
+k.set_contents_from_filename('foobar', headers=DEVPAY_HEADERS)
+k.name = 'foo/bat'
+k.set_contents_from_string(s1, headers=DEVPAY_HEADERS)
+k.name = 'fie/bar'
+k.set_contents_from_string(s1, headers=DEVPAY_HEADERS)
+k.name = 'fie/bas'
+k.set_contents_from_string(s1, headers=DEVPAY_HEADERS)
+k.name = 'fie/bat'
+k.set_contents_from_string(s1, headers=DEVPAY_HEADERS)
+# try resetting the contents to another value
+md5 = k.md5
+k.set_contents_from_string(s2, headers=DEVPAY_HEADERS)
+assert k.md5 != md5
+os.unlink('foobar')
+all = bucket.get_all_keys(headers=DEVPAY_HEADERS)
+assert len(all) == 6
+rs = bucket.get_all_keys(prefix='foo', headers=DEVPAY_HEADERS)
+assert len(rs) == 3
+rs = bucket.get_all_keys(prefix='', delimiter='/', headers=DEVPAY_HEADERS)
+assert len(rs) == 2
+rs = bucket.get_all_keys(maxkeys=5, headers=DEVPAY_HEADERS)
+assert len(rs) == 5
+# test the lookup method
+k = bucket.lookup('foo/bar', headers=DEVPAY_HEADERS)
+assert isinstance(k, bucket.key_class)
+assert k.content_type == phony_mimetype
+k = bucket.lookup('notthere', headers=DEVPAY_HEADERS)
+assert k == None
+# try some metadata stuff
+k = bucket.new_key()
+k.name = 'has_metadata'
+mdkey1 = 'meta1'
+mdval1 = 'This is the first metadata value'
+k.set_metadata(mdkey1, mdval1)
+mdkey2 = 'meta2'
+mdval2 = 'This is the second metadata value'
+k.set_metadata(mdkey2, mdval2)
+k.set_contents_from_string(s1, headers=DEVPAY_HEADERS)
+k = bucket.lookup('has_metadata', headers=DEVPAY_HEADERS)
+assert k.get_metadata(mdkey1) == mdval1
+assert k.get_metadata(mdkey2) == mdval2
+k = bucket.new_key()
+k.name = 'has_metadata'
+k.get_contents_as_string(headers=DEVPAY_HEADERS)
+assert k.get_metadata(mdkey1) == mdval1
+assert k.get_metadata(mdkey2) == mdval2
+bucket.delete_key(k, headers=DEVPAY_HEADERS)
+# test list and iterator
+rs1 = bucket.list(headers=DEVPAY_HEADERS)
+num_iter = 0
+for r in rs1:
+    num_iter = num_iter + 1
+rs = bucket.get_all_keys(headers=DEVPAY_HEADERS)
+num_keys = len(rs)
+assert num_iter == num_keys
+# try a key with a funny character
+k = bucket.new_key()
+k.name = 'testnewline\n'
+k.set_contents_from_string('This is a test', headers=DEVPAY_HEADERS)
+rs = bucket.get_all_keys(headers=DEVPAY_HEADERS)
+assert len(rs) == num_keys + 1
+bucket.delete_key(k, headers=DEVPAY_HEADERS)
+rs = bucket.get_all_keys(headers=DEVPAY_HEADERS)
+assert len(rs) == num_keys
+# try some acl stuff
+bucket.set_acl('public-read', headers=DEVPAY_HEADERS)
+policy = bucket.get_acl(headers=DEVPAY_HEADERS)
+assert len(policy.acl.grants) == 2
+bucket.set_acl('private', headers=DEVPAY_HEADERS)
+policy = bucket.get_acl(headers=DEVPAY_HEADERS)
+assert len(policy.acl.grants) == 1
+k = bucket.lookup('foo/bar', headers=DEVPAY_HEADERS)
+k.set_acl('public-read', headers=DEVPAY_HEADERS)
+policy = k.get_acl(headers=DEVPAY_HEADERS)
+assert len(policy.acl.grants) == 2
+k.set_acl('private', headers=DEVPAY_HEADERS)
+policy = k.get_acl(headers=DEVPAY_HEADERS)
+assert len(policy.acl.grants) == 1
+# try the convenience methods for grants
+# this doesn't work with devpay
+#bucket.add_user_grant('FULL_CONTROL',
+#                      'c1e724fbfa0979a4448393c59a8c055011f739b6d102fb37a65f26414653cd67',
+#                      headers=DEVPAY_HEADERS)
+try:
+    bucket.add_email_grant('foobar', 'foo@bar.com', headers=DEVPAY_HEADERS)
+except S3PermissionsError:
+    pass
+# now delete all keys in bucket
+for k in all:
+    bucket.delete_key(k, headers=DEVPAY_HEADERS)
+# now delete bucket
+
+c.delete_bucket(bucket, headers=DEVPAY_HEADERS)
+
+print '--- tests completed ---'

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/tests/test.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/tests/test.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
    (empty)

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_ec2connection.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/tests/test_ec2connection.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_ec2connection.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_ec2connection.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/tests/test_ec2connection.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
    (empty)

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_s3connection.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/tests/test_s3connection.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_s3connection.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_s3connection.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/tests/test_s3connection.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.8d/boto/tests/test_s3connection.py (original)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_s3connection.py Sun Jun  5 08:34:02 2011
@@ -28,6 +28,7 @@ Some unit tests for the S3Connection
 import unittest
 import time
 import os
+import urllib
 from boto.s3.connection import S3Connection
 from boto.exception import S3PermissionsError
 
@@ -41,7 +42,12 @@ class S3ConnectionTest (unittest.TestCas
         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)
-        # create a new key and store it's content from a string
+        # 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'
@@ -55,6 +61,13 @@ 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
@@ -110,9 +123,15 @@ class S3ConnectionTest (unittest.TestCas
         assert k.get_metadata(mdkey1) == mdval1
         assert k.get_metadata(mdkey2) == mdval2
         bucket.delete_key(k)
-        # try a key with a funny character
+        # test list and iterator
+        rs1 = bucket.list()
+        num_iter = 0
+        for r in rs1:
+            num_iter = num_iter + 1
         rs = bucket.get_all_keys()
         num_keys = len(rs)
+        assert num_iter == num_keys
+        # try a key with a funny character
         k = bucket.new_key()
         k.name = 'testnewline\n'
         k.set_contents_from_string('This is a test')

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_sdbconnection.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/tests/test_sdbconnection.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_sdbconnection.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_sdbconnection.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/tests/test_sdbconnection.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
    (empty)

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_sqsconnection.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/tests/test_sqsconnection.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_sqsconnection.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/tests/test_sqsconnection.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/tests/test_sqsconnection.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
    (empty)

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/utils.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/utils.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/utils.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/utils.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/utils.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.8d/boto/utils.py (original)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/utils.py Sun Jun  5 08:34:02 2011
@@ -47,6 +47,13 @@ import logging.handlers
 import boto
 import tempfile
 import smtplib
+import datetime
+from email.MIMEMultipart import MIMEMultipart
+from email.MIMEBase import MIMEBase
+from email.MIMEText import MIMEText
+from email.Utils import formatdate
+from email import Encoders
+
 try:
     import hashlib
     _hashfn = hashlib.sha512
@@ -110,7 +117,9 @@ def canonical_string(method, path, heade
 def merge_meta(headers, metadata):
     final_headers = headers.copy()
     for k in metadata.keys():
-        if k.lower() in ['content-md5', 'content-type', 'date']:
+        if k.lower() in ['cache-control', 'content-md5', 'content-type',
+                         'content-encoding', 'content-disposition',
+                         'date', 'expires']:
             final_headers[k] = metadata[k]
         else:
             final_headers[METADATA_PREFIX + k] = metadata[k]
@@ -125,34 +134,63 @@ def get_aws_metadata(headers):
             del headers[hkey]
     return metadata
 
-def retry_url(url):
+def retry_url(url, retry_on_404=True):
     for i in range(0, 10):
         try:
             req = urllib2.Request(url)
             resp = urllib2.urlopen(req)
             return resp.read()
+        except urllib2.HTTPError, e:
+            # in 2.6 you use getcode(), in 2.5 and earlier you use code
+            if hasattr(e, 'getcode'):
+                code = e.getcode()
+            else:
+                code = e.code
+            if code == 404 and not retry_on_404:
+                return ''
         except:
-            boto.log.exception('Caught exception reading instance data')
-            time.sleep(2**i)
+            pass
+        boto.log.exception('Caught exception reading instance data')
+        time.sleep(2**i)
     boto.log.error('Unable to read instance data, giving up')
     return ''
-    
-def get_instance_metadata(version='latest'):
-    metadata = {}
-    url = 'http://169.254.169.254/%s/meta-data/' % version
+
+def _get_instance_metadata(url):
+    d = {}
     data = retry_url(url)
     if data:
-        md_fields = data.split('\n')
-        for md in md_fields:
-            val = retry_url(url + md)
-            if val.find('\n') > 0:
-                val = val.split('\n')
-            metadata[md] = val
-    return metadata
+        fields = data.split('\n')
+        for field in fields:
+            if field.endswith('/'):
+                d[field[0:-1]] = _get_instance_metadata(url + field)
+            else:
+                p = field.find('=')
+                if p > 0:
+                    key = field[p+1:]
+                    resource = field[0:p] + '/openssh-key'
+                else:
+                    key = resource = field
+                val = retry_url(url + resource)
+                p = val.find('\n')
+                if p > 0:
+                    val = val.split('\n')
+                d[key] = val
+    return d
+
+def get_instance_metadata(version='latest'):
+    """
+    Returns the instance metadata as a nested Python dictionary.
+    Simple values (e.g. local_hostname, hostname, etc.) will be
+    stored as string values.  Values such as ancestor-ami-ids will
+    be stored in the dict as a list of string values.  More complex
+    fields such as public-keys and will be stored as nested dicts.
+    """
+    url = 'http://169.254.169.254/%s/meta-data/' % version
+    return _get_instance_metadata(url)
 
 def get_instance_userdata(version='latest', sep=None):
-    url = 'http://169.254.169.254/%s/user-data/' % version
-    user_data = retry_url(url)
+    url = 'http://169.254.169.254/%s/user-data' % version
+    user_data = retry_url(url, retry_on_404=False)
     if user_data:
         if sep:
             l = user_data.split(sep)
@@ -211,7 +249,7 @@ def fetch_file(uri, file=None, username=
     try:
         working_dir = boto.config.get("General", "working_dir")
         if uri.startswith('s3://'):
-            bucket_name, key_name = uri[len('s3://'):].split('/')
+            bucket_name, key_name = uri[len('s3://'):].split('/', 1)
             c = boto.connect_s3()
             bucket = c.get_bucket(bucket_name)
             key = bucket.get_key(key_name)
@@ -462,29 +500,61 @@ class Password(object):
         return str(self.str)
    
     def __eq__(self, other):
+        if other == None:
+            return False
         return str(_hashfn(other).hexdigest()) == str(self.str)
 
     def __len__(self):
-        return len(self.str)
+        if self.str:
+            return len(self.str)
+        else:
+            return 0
 
-def notify(subject, body=''):
-    subject = "[%s] %s" % (boto.config.get_value("Instance", "instance-id"), subject)
-    to_string = boto.config.get_value('Notification', 'smtp_to', None)
+def notify(subject, body=None, html_body=None, to_string=None, attachments=[], append_instance_id=True):
+    if append_instance_id:
+        subject = "[%s] %s" % (boto.config.get_value("Instance", "instance-id"), subject)
+    if not to_string:
+        to_string = boto.config.get_value('Notification', 'smtp_to', None)
     if to_string:
         try:
             from_string = boto.config.get_value('Notification', 'smtp_from', 'boto')
-            msg = "From: %s\n" % from_string
-            msg += "To: %s\n" % to_string
-            msg += "Subject: %s\n\n" % subject
-            msg += body
+            msg = MIMEMultipart()
+            msg['From'] = from_string
+            msg['To'] = to_string
+            msg['Date'] = formatdate(localtime=True)
+            msg['Subject'] = subject
+        
+            if body:
+                msg.attach(MIMEText(body))
+
+            if html_body:
+                part = MIMEBase('text', 'html')
+                part.set_payload(html_body)
+                Encoders.encode_base64(part)
+                msg.attach(part)
+
+            for part in attachments:
+                msg.attach(part)
+
             smtp_host = boto.config.get_value('Notification', 'smtp_host', 'localhost')
-            server = smtplib.SMTP(smtp_host)
+
+            # Alternate port support
+            if boto.config.get_value("Notification", "smtp_port"):
+                server = smtplib.SMTP(smtp_host, int(boto.config.get_value("Notification", "smtp_port")))
+            else:
+                server = smtplib.SMTP(smtp_host)
+
+            # TLS support
+            if boto.config.getbool("Notification", "smtp_tls"):
+                server.ehlo()
+                server.starttls()
+                server.ehlo()
             smtp_user = boto.config.get_value('Notification', 'smtp_user', '')
             smtp_pass = boto.config.get_value('Notification', 'smtp_pass', '')
             if smtp_user:
                 server.login(smtp_user, smtp_pass)
-            server.sendmail(from_string, to_string, msg)
+            server.sendmail(from_string, to_string, msg.as_string())
             server.quit()
         except:
-            boto.log.error('notify failed')
+            boto.log.exception('notify failed')
 

Added: incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/__init__.py
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/__init__.py?rev=1132067&view=auto
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/__init__.py (added)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/__init__.py Sun Jun  5 08:34:02 2011
@@ -0,0 +1,478 @@
+# Copyright (c) 2009 Mitch Garnaat http://garnaat.org/
+#
+# 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.
+
+"""
+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
+from boto.vpc.dhcpoptions import DhcpOptions
+from boto.vpc.subnet import Subnet
+from boto.vpc.vpnconnection import VpnConnection
+
+class VPCConnection(EC2Connection):
+
+    # VPC methods
+        
+    def get_all_vpcs(self, vpc_ids=None, filters=None):
+        """
+        Retrieve information about your VPCs.  You can filter results to
+        return information only about those VPCs that match your search
+        parameters.  Otherwise, all VPCs associated with your account
+        are returned.
+        
+        :type vpc_ids: list
+        :param vpc_ids: A list of strings with the desired VPC ID's
+        
+        :type filters: list of tuples
+        :param filters: A list of tuples containing filters.  Each tuple
+                        consists of a filter key and a filter value.
+                        Possible filter keys are:
+                        
+                        - *state*, the state of the VPC (pending or available)
+                        - *cidrBlock*, CIDR block of the VPC
+                        - *dhcpOptionsId*, the ID of a set of DHCP options
+
+        :rtype: list
+        :return: A list of :class:`boto.vpc.vpc.VPC`
+        """
+        params = {}
+        if vpc_ids:
+            self.build_list_params(params, vpc_ids, 'VpcId')
+        if filters:
+            i = 1
+            for filter in filters:
+                params[('Filter.%d.Key' % i)] = filter[0]
+                params[('Filter.%d.Value.1')] = filter[1]
+                i += 1
+        return self.get_list('DescribeVpcs', params, [('item', VPC)])
+
+    def create_vpc(self, cidr_block):
+        """
+        Create a new Virtual Private Cloud.
+
+        :type cidr_block: str
+        :param cidr_block: A valid CIDR block
+
+        :rtype: The newly created VPC
+        :return: A :class:`boto.vpc.vpc.VPC` object
+        """
+        params = {'CidrBlock' : cidr_block}
+        return self.get_object('CreateVpc', params, VPC)
+        
+    def delete_vpc(self, vpc_id):
+        """
+        Delete a Virtual Private Cloud.
+
+        :type vpc_id: str
+        :param vpc_id: The ID of the vpc to be deleted.
+
+        :rtype: bool
+        :return: True if successful
+        """
+        params = {'VpcId': vpc_id}
+        return self.get_status('DeleteVpc', params)
+
+    # Customer Gateways
+
+    def get_all_customer_gateways(self, customer_gateway_ids=None, filters=None):
+        """
+        Retrieve information about your CustomerGateways.  You can filter results to
+        return information only about those CustomerGateways that match your search
+        parameters.  Otherwise, all CustomerGateways associated with your account
+        are returned.
+        
+        :type customer_gateway_ids: list
+        :param customer_gateway_ids: A list of strings with the desired CustomerGateway ID's
+        
+        :type filters: list of tuples
+        :param filters: A list of tuples containing filters.  Each tuple
+                        consists of a filter key and a filter value.
+                        Possible filter keys are:
+                        
+                         - *state*, the state of the CustomerGateway
+                           (pending,available,deleting,deleted)
+                         - *type*, the type of customer gateway (ipsec.1)
+                         - *ipAddress* the IP address of customer gateway's
+                           internet-routable external inteface
+
+        :rtype: list
+        :return: A list of :class:`boto.vpc.customergateway.CustomerGateway`
+        """
+        params = {}
+        if customer_gateway_ids:
+            self.build_list_params(params, customer_gateway_ids, 'CustomerGatewayId')
+        if filters:
+            i = 1
+            for filter in filters:
+                params[('Filter.%d.Key' % i)] = filter[0]
+                params[('Filter.%d.Value.1')] = filter[1]
+                i += 1
+        return self.get_list('DescribeCustomerGateways', params, [('item', CustomerGateway)])
+
+    def create_customer_gateway(self, type, ip_address, bgp_asn):
+        """
+        Create a new Customer Gateway
+
+        :type type: str
+        :param type: Type of VPN Connection.  Only valid valid currently is 'ipsec.1'
+
+        :type ip_address: str
+        :param ip_address: Internet-routable IP address for customer's gateway.
+                           Must be a static address.
+
+        :type bgp_asn: str
+        :param bgp_asn: Customer gateway's Border Gateway Protocol (BGP)
+                        Autonomous System Number (ASN)
+
+        :rtype: The newly created CustomerGateway
+        :return: A :class:`boto.vpc.customergateway.CustomerGateway` object
+        """
+        params = {'Type' : type,
+                  'IpAddress' : ip_address,
+                  'BgpAsn' : bgp_asn}
+        return self.get_object('CreateCustomerGateway', params, CustomerGateway)
+        
+    def delete_customer_gateway(self, customer_gateway_id):
+        """
+        Delete a Customer Gateway.
+
+        :type customer_gateway_id: str
+        :param customer_gateway_id: The ID of the customer_gateway to be deleted.
+
+        :rtype: bool
+        :return: True if successful
+        """
+        params = {'CustomerGatewayId': customer_gateway_id}
+        return self.get_status('DeleteCustomerGateway', params)
+
+    # VPN Gateways
+
+    def get_all_vpn_gateways(self, vpn_gateway_ids=None, filters=None):
+        """
+        Retrieve information about your VpnGateways.  You can filter results to
+        return information only about those VpnGateways that match your search
+        parameters.  Otherwise, all VpnGateways associated with your account
+        are returned.
+
+        :type vpn_gateway_ids: list
+        :param vpn_gateway_ids: A list of strings with the desired VpnGateway ID's
+        
+        :type filters: list of tuples
+        :param filters: A list of tuples containing filters.  Each tuple
+                        consists of a filter key and a filter value.
+                        Possible filter keys are:
+                        
+                        - *state*, the state of the VpnGateway
+                          (pending,available,deleting,deleted)
+                        - *type*, the type of customer gateway (ipsec.1)
+                        - *availabilityZone*, the Availability zone the
+                          VPN gateway is in.
+
+        :rtype: list
+        :return: A list of :class:`boto.vpc.customergateway.VpnGateway`
+        """
+        params = {}
+        if vpn_gateway_ids:
+            self.build_list_params(params, vpn_gateway_ids, 'VpnGatewayId')
+        if filters:
+            i = 1
+            for filter in filters:
+                params[('Filter.%d.Key' % i)] = filter[0]
+                params[('Filter.%d.Value.1')] = filter[1]
+                i += 1
+        return self.get_list('DescribeVpnGateways', params, [('item', VpnGateway)])
+
+    def create_vpn_gateway(self, type, availability_zone=None):
+        """
+        Create a new Vpn Gateway
+
+        :type type: str
+        :param type: Type of VPN Connection.  Only valid valid currently is 'ipsec.1'
+
+        :type availability_zone: str
+        :param availability_zone: The Availability Zone where you want the VPN gateway.
+
+        :rtype: The newly created VpnGateway
+        :return: A :class:`boto.vpc.vpngateway.VpnGateway` object
+        """
+        params = {'Type' : type}
+        if availability_zone:
+            params['AvailabilityZone'] = availability_zone
+        return self.get_object('CreateVpnGateway', params, VpnGateway)
+        
+    def delete_vpn_gateway(self, vpn_gateway_id):
+        """
+        Delete a Vpn Gateway.
+
+        :type vpn_gateway_id: str
+        :param vpn_gateway_id: The ID of the vpn_gateway to be deleted.
+
+        :rtype: bool
+        :return: True if successful
+        """
+        params = {'VpnGatewayId': vpn_gateway_id}
+        return self.get_status('DeleteVpnGateway', params)
+
+    def attach_vpn_gateway(self, vpn_gateway_id, vpc_id):
+        """
+        Attaches a VPN gateway to a VPC.
+
+        :type vpn_gateway_id: str
+        :param vpn_gateway_id: The ID of the vpn_gateway to attach
+
+        :type vpc_id: str
+        :param vpc_id: The ID of the VPC you want to attach the gateway to.
+
+        :rtype: An attachment
+        :return: a :class:`boto.vpc.vpngateway.Attachment`
+        """
+        params = {'VpnGatewayId': vpn_gateway_id,
+                  'VpcId' : vpc_id}
+        return self.get_object('AttachVpnGateway', params, Attachment)
+
+    # Subnets
+
+    def get_all_subnets(self, subnet_ids=None, filters=None):
+        """
+        Retrieve information about your Subnets.  You can filter results to
+        return information only about those Subnets that match your search
+        parameters.  Otherwise, all Subnets associated with your account
+        are returned.
+        
+        :type subnet_ids: list
+        :param subnet_ids: A list of strings with the desired Subnet ID's
+        
+        :type filters: list of tuples
+        :param filters: A list of tuples containing filters.  Each tuple
+                        consists of a filter key and a filter value.
+                        Possible filter keys are:
+                        
+                        - *state*, the state of the Subnet
+                          (pending,available)
+                        - *vpdId*, the ID of teh VPC the subnet is in.
+                        - *cidrBlock*, CIDR block of the subnet
+                        - *availabilityZone*, the Availability Zone
+                          the subnet is in.
+
+
+        :rtype: list
+        :return: A list of :class:`boto.vpc.subnet.Subnet`
+        """
+        params = {}
+        if subnet_ids:
+            self.build_list_params(params, subnet_ids, 'SubnetId')
+        if filters:
+            i = 1
+            for filter in filters:
+                params[('Filter.%d.Key' % i)] = filter[0]
+                params[('Filter.%d.Value.1')] = filter[1]
+                i += 1
+        return self.get_list('DescribeSubnets', params, [('item', Subnet)])
+
+    def create_subnet(self, vpc_id, cidr_block, availability_zone=None):
+        """
+        Create a new Subnet
+
+        :type vpc_id: str
+        :param vpc_id: The ID of the VPC where you want to create the subnet.
+
+        :type cidr_block: str
+        :param cidr_block: The CIDR block you want the subnet to cover.
+
+        :type availability_zone: str
+        :param availability_zone: The AZ you want the subnet in
+
+        :rtype: The newly created Subnet
+        :return: A :class:`boto.vpc.customergateway.Subnet` object
+        """
+        params = {'VpcId' : vpc_id,
+                  'CidrBlock' : cidr_block}
+        if availability_zone:
+            params['AvailabilityZone'] = availability_zone
+        return self.get_object('CreateSubnet', params, Subnet)
+        
+    def delete_subnet(self, subnet_id):
+        """
+        Delete a subnet.
+
+        :type subnet_id: str
+        :param subnet_id: The ID of the subnet to be deleted.
+
+        :rtype: bool
+        :return: True if successful
+        """
+        params = {'SubnetId': subnet_id}
+        return self.get_status('DeleteSubnet', params)
+
+    
+    # DHCP Options
+
+    def get_all_dhcp_options(self, dhcp_options_ids=None):
+        """
+        Retrieve information about your DhcpOptions.
+        
+        :type dhcp_options_ids: list
+        :param dhcp_options_ids: A list of strings with the desired DhcpOption ID's
+        
+        :rtype: list
+        :return: A list of :class:`boto.vpc.dhcpoptions.DhcpOptions`
+        """
+        params = {}
+        if dhcp_options_ids:
+            self.build_list_params(params, dhcp_options_ids, 'DhcpOptionsId')
+        return self.get_list('DescribeDhcpOptions', params, [('item', DhcpOptions)])
+
+    def create_dhcp_options(self, vpc_id, cidr_block, availability_zone=None):
+        """
+        Create a new DhcpOption
+
+        :type vpc_id: str
+        :param vpc_id: The ID of the VPC where you want to create the subnet.
+
+        :type cidr_block: str
+        :param cidr_block: The CIDR block you want the subnet to cover.
+
+        :type availability_zone: str
+        :param availability_zone: The AZ you want the subnet in
+
+        :rtype: The newly created DhcpOption
+        :return: A :class:`boto.vpc.customergateway.DhcpOption` object
+        """
+        params = {'VpcId' : vpc_id,
+                  'CidrBlock' : cidr_block}
+        if availability_zone:
+            params['AvailabilityZone'] = availability_zone
+        return self.get_object('CreateDhcpOption', params, DhcpOptions)
+        
+    def delete_dhcp_options(self, dhcp_options_id):
+        """
+        Delete a DHCP Options
+
+        :type dhcp_options_id: str
+        :param dhcp_options_id: The ID of the DHCP Options to be deleted.
+
+        :rtype: bool
+        :return: True if successful
+        """
+        params = {'DhcpOptionsId': subnet_id}
+        return self.get_status('DeleteDhcpOptions', params)
+
+    def associate_dhcp_options(self, dhcp_options_id, vpc_id):
+        """
+        Associate a set of Dhcp Options with a VPC.
+        
+        :type dhcp_options_id: str
+        :param dhcp_options_id: The ID of the Dhcp Options
+        
+        :type vpc_id: str
+        :param vpc_id: The ID of the VPC.
+        
+        :rtype: bool
+        :return: True if successful
+        """
+        params = {'DhcpOptionsId': dhcp_option,
+                  'VpcId' : vpc_id}
+        return self.get_status('AssociateDhcpOptions', params)
+
+    # VPN Connection
+
+    def get_all_vpn_connections(self, vpn_connection_ids=None, filters=None):
+        """
+        Retrieve information about your VPN_CONNECTIONs.  You can filter results to
+        return information only about those VPN_CONNECTIONs that match your search
+        parameters.  Otherwise, all VPN_CONNECTIONs associated with your account
+        are returned.
+        
+        :type vpn_connection_ids: list
+        :param vpn_connection_ids: A list of strings with the desired VPN_CONNECTION ID's
+        
+        :type filters: list of tuples
+        :param filters: A list of tuples containing filters.  Each tuple
+                        consists of a filter key and a filter value.
+                        Possible filter keys are:
+                        
+                        - *state*, the state of the VPN_CONNECTION
+                          pending,available,deleting,deleted
+                        - *type*, the type of connection, currently 'ipsec.1'
+                        - *customerGatewayId*, the ID of the customer gateway
+                          associated with the VPN
+                        - *vpnGatewayId*, the ID of the VPN gateway associated
+                          with the VPN connection
+
+        :rtype: list
+        :return: A list of :class:`boto.vpn_connection.vpnconnection.VpnConnection`
+        """
+        params = {}
+        if vpn_connection_ids:
+            self.build_list_params(params, vpn_connection_ids, 'Vpn_ConnectionId')
+        if filters:
+            i = 1
+            for filter in filters:
+                params[('Filter.%d.Key' % i)] = filter[0]
+                params[('Filter.%d.Value.1')] = filter[1]
+                i += 1
+        return self.get_list('DescribeVpnConnections', params, [('item', VPNConnection)])
+
+    def create_vpn_connection(self, type, customer_gateway_id, vpn_gateway_id):
+        """
+        Create a new VPN Connection.
+
+        :type type: str
+        :param type: The type of VPN Connection.  Currently only 'ipsec.1'
+                     is supported
+
+        :type customer_gateway_id: str
+        :param customer_gateway_id: The ID of the customer gateway.
+
+        :type vpn_gateway_id: str
+        :param vpn_gateway_id: The ID of the VPN gateway.
+
+        :rtype: The newly created VpnConnection
+        :return: A :class:`boto.vpc.vpnconnection.VpnConnection` object
+        """
+        params = {'Type' : type,
+                  'CustomerGatewayId' : customer_gateway_id,
+                  'VpnGatewayId' : vpn_gateway_id}
+        return self.get_object('CreateVpnConnection', params, VpnConnection)
+        
+    def delete_vpn_connection(self, vpn_connection_id):
+        """
+        Delete a VPN Connection.
+
+        :type vpn_connection_id: str
+        :param vpn_connection_id: The ID of the vpn_connection to be deleted.
+
+        :rtype: bool
+        :return: True if successful
+        """
+        params = {'VpnConnectionId': vpn_connection_id}
+        return self.get_status('DeleteVpnConnection', params)
+
+    

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/customergateway.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/zone.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/customergateway.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/customergateway.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/zone.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/zone.py (original)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/customergateway.py Sun Jun  5 08:34:02 2011
@@ -1,4 +1,4 @@
-# Copyright (c) 2006-2008 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2009 Mitch Garnaat http://garnaat.org/
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the
@@ -20,28 +20,35 @@
 # IN THE SOFTWARE.
 
 """
-Represents an EC2 Availability Zone
+Represents a Customer Gateway
 """
+
 from boto.ec2.ec2object import EC2Object
 
-class Zone(EC2Object):
-    
+class CustomerGateway(EC2Object):
+
     def __init__(self, connection=None):
         EC2Object.__init__(self, connection)
-        self.name = None
+        self.id = None
+        self.type = None
         self.state = None
+        self.ip_address = None
+        self.bgp_asn = None
 
     def __repr__(self):
-        return 'Zone:%s' % self.name
-
+        return 'CustomerGateway:%s' % self.id
+    
     def endElement(self, name, value, connection):
-        if name == 'zoneName':
-            self.name = value
-        elif name == 'zoneState':
+        if name == 'customerGatewayId':
+            self.id = value
+        elif name == 'ipAddress':
+            self.ip_address = value
+        elif name == 'type':
+            self.type = value
+        elif name == 'state':
             self.state = value
+        elif name == 'bgpAsn':
+            self.bgp_asn = value
         else:
             setattr(self, name, value)
 
-
-
-

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/dhcpoptions.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/snapshot.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/dhcpoptions.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/dhcpoptions.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/snapshot.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/snapshot.py (original)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/dhcpoptions.py Sun Jun  5 08:34:02 2011
@@ -1,4 +1,4 @@
-# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2009 Mitch Garnaat http://garnaat.org/
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the
@@ -20,46 +20,50 @@
 # IN THE SOFTWARE.
 
 """
-Represents an EC2 Elastic IP Snapshot
+Represents a DHCP Options set
 """
+
 from boto.ec2.ec2object import EC2Object
 
-class Snapshot(EC2Object):
+class DhcpValueSet(list):
+
+    def startElement(self, name, attrs, connection):
+        pass
+
+    def endElement(self, name, value, connection):
+        if name == 'value':
+            self.append(value)
+    
+class DhcpConfigSet(dict):
+
+    def startElement(self, name, attrs, connection):
+        if name == 'valueSet':
+            if not self.has_key(self._name):
+                self[self._name] = DhcpValueSet()
+            return self[self._name]
+
+    def endElement(self, name, value, connection):
+        if name == 'key':
+            self._name = value
     
+class DhcpOptions(EC2Object):
+
     def __init__(self, connection=None):
         EC2Object.__init__(self, connection)
         self.id = None
-        self.progress = None
-        self.start_time = None
-        self.volume_id = None
-        self.status = None
+        self.options = None
 
     def __repr__(self):
-        return 'Snapshot:%s' % self.id
+        return 'DhcpOptions:%s' % self.id
+    
+    def startElement(self, name, attrs, connection):
+        if name == 'dhcpConfigurationSet':
+            self.options = DhcpConfigSet()
+            return self.options
 
     def endElement(self, name, value, connection):
-        if name == 'snapshotId':
+        if name == 'dhcpOptionsId':
             self.id = value
-        elif name == 'volumeId':
-            self.volume_id = value
-        elif name == 'startTime':
-            self.start_time = value
-        elif name == 'status':
-            self.status = value
         else:
             setattr(self, name, value)
 
-    def _update(self, updated):
-        self.progress = updated.progress
-
-    def update(self):
-        rs = self.connection.get_all_snapshots([self.id])
-        if len(rs) > 0:
-            self._update(rs[0])
-        return self.progress
-    
-    def delete(self):
-        return self.connection.delete_snapshot(self.id)
-
-
-

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/subnet.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/zone.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/subnet.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/subnet.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/zone.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/zone.py (original)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/subnet.py Sun Jun  5 08:34:02 2011
@@ -1,4 +1,4 @@
-# Copyright (c) 2006-2008 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2009 Mitch Garnaat http://garnaat.org/
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the
@@ -20,28 +20,35 @@
 # IN THE SOFTWARE.
 
 """
-Represents an EC2 Availability Zone
+Represents a Subnet
 """
+
 from boto.ec2.ec2object import EC2Object
 
-class Zone(EC2Object):
-    
+class Subnet(EC2Object):
+
     def __init__(self, connection=None):
         EC2Object.__init__(self, connection)
-        self.name = None
+        self.id = None
         self.state = None
+        self.cidr_block = None
+        self.available_ip_address_count = 0
+        self.availability_zone = None
 
     def __repr__(self):
-        return 'Zone:%s' % self.name
-
+        return 'Subnet:%s' % self.id
+    
     def endElement(self, name, value, connection):
-        if name == 'zoneName':
-            self.name = value
-        elif name == 'zoneState':
+        if name == 'subnetId':
+            self.id = value
+        elif name == 'state':
             self.state = value
+        elif name == 'cidrBlock':
+            self.cidr_block = value
+        elif name == 'availableIpAddressCount':
+            self.available_ip_address_count = int(value)
+        elif name == 'availabilityZone':
+            self.availability_zone = value
         else:
             setattr(self, name, value)
 
-
-
-

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpc.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/snapshot.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpc.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpc.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/snapshot.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/snapshot.py (original)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpc.py Sun Jun  5 08:34:02 2011
@@ -1,4 +1,4 @@
-# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2009 Mitch Garnaat http://garnaat.org/
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the
@@ -20,46 +20,35 @@
 # IN THE SOFTWARE.
 
 """
-Represents an EC2 Elastic IP Snapshot
+Represents a Virtual Private Cloud.
 """
+
 from boto.ec2.ec2object import EC2Object
 
-class Snapshot(EC2Object):
-    
+class VPC(EC2Object):
+
     def __init__(self, connection=None):
         EC2Object.__init__(self, connection)
         self.id = None
-        self.progress = None
-        self.start_time = None
-        self.volume_id = None
-        self.status = None
+        self.dhcp_options_id = None
+        self.state = None
+        self.cidr_block = None
 
     def __repr__(self):
-        return 'Snapshot:%s' % self.id
-
+        return 'VPC:%s' % self.id
+    
     def endElement(self, name, value, connection):
-        if name == 'snapshotId':
+        if name == 'vpcId':
             self.id = value
-        elif name == 'volumeId':
-            self.volume_id = value
-        elif name == 'startTime':
-            self.start_time = value
-        elif name == 'status':
-            self.status = value
+        elif name == 'dhcpOptionsId':
+            self.dhcp_options_id = value
+        elif name == 'state':
+            self.state = value
+        elif name == 'cidrBlock':
+            self.cidr_block = value
         else:
             setattr(self, name, value)
 
-    def _update(self, updated):
-        self.progress = updated.progress
-
-    def update(self):
-        rs = self.connection.get_all_snapshots([self.id])
-        if len(rs) > 0:
-            self._update(rs[0])
-        return self.progress
-    
     def delete(self):
-        return self.connection.delete_snapshot(self.id)
-
-
+        return self.connection.delete_vpc(self.id)
 

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpnconnection.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/snapshot.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpnconnection.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpnconnection.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/snapshot.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/snapshot.py (original)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpnconnection.py Sun Jun  5 08:34:02 2011
@@ -1,4 +1,4 @@
-# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2009 Mitch Garnaat http://garnaat.org/
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the
@@ -20,46 +20,41 @@
 # IN THE SOFTWARE.
 
 """
-Represents an EC2 Elastic IP Snapshot
+Represents a VPN Connectionn
 """
+
 from boto.ec2.ec2object import EC2Object
 
-class Snapshot(EC2Object):
-    
+class VpnConnection(EC2Object):
+
     def __init__(self, connection=None):
         EC2Object.__init__(self, connection)
         self.id = None
-        self.progress = None
-        self.start_time = None
-        self.volume_id = None
-        self.status = None
+        self.state = None
+        self.customer_gateway_configuration = None
+        self.type = None
+        self.customer_gateway_id = None
+        self.vpn_gateway_id = Nonen
 
     def __repr__(self):
-        return 'Snapshot:%s' % self.id
-
+        return 'VpnConnection:%s' % self.id
+    
     def endElement(self, name, value, connection):
-        if name == 'snapshotId':
+        if name == 'vpnConnectionId':
             self.id = value
-        elif name == 'volumeId':
-            self.volume_id = value
-        elif name == 'startTime':
-            self.start_time = value
-        elif name == 'status':
-            self.status = value
+        elif name == 'state':
+            self.state = value
+        elif name == 'CustomerGatewayConfiguration':
+            self.customer_gateway_configuration = value
+        elif name == 'type':
+            self.type = value
+        elif name == 'customerGatewayId':
+            self.customer_gateway_id = value
+        elif name == 'vpnGatewayId':
+            self.vpn_gateway_id = value
         else:
             setattr(self, name, value)
 
-    def _update(self, updated):
-        self.progress = updated.progress
-
-    def update(self):
-        rs = self.connection.get_all_snapshots([self.id])
-        if len(rs) > 0:
-            self._update(rs[0])
-        return self.progress
-    
     def delete(self):
-        return self.connection.delete_snapshot(self.id)
-
-
+        return self.connection.delete_vpn_connection(self.id)
 

Copied: incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpngateway.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/snapshot.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpngateway.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpngateway.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/snapshot.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.8d/boto/ec2/snapshot.py (original)
+++ incubator/mesos/trunk/third_party/boto-1.9b/boto/vpc/vpngateway.py Sun Jun  5 08:34:02 2011
@@ -1,4 +1,4 @@
-# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2009 Mitch Garnaat http://garnaat.org/
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the
@@ -20,46 +20,61 @@
 # IN THE SOFTWARE.
 
 """
-Represents an EC2 Elastic IP Snapshot
+Represents a Vpn Gateway
 """
+
 from boto.ec2.ec2object import EC2Object
 
-class Snapshot(EC2Object):
+class Attachment(object):
+
+    def __init__(self, connection=None):
+        self.vpc_id = None
+        self.state = None
+
+    def startElement(self, name, attrs, connection):
+        pass
     
+    def endElement(self, name, value, connection):
+        if name == 'vpcId':
+            self.vpc_id = value
+        elif name == 'state':
+            self.state = value
+        else:
+            setattr(self, name, value)
+            
+class VpnGateway(EC2Object):
+
     def __init__(self, connection=None):
         EC2Object.__init__(self, connection)
         self.id = None
-        self.progress = None
-        self.start_time = None
-        self.volume_id = None
-        self.status = None
+        self.type = None
+        self.state = None
+        self.availability_zone = None
+        self.attachments = []
 
     def __repr__(self):
-        return 'Snapshot:%s' % self.id
+        return 'VpnGateway:%s' % self.id
 
+    def startElement(self, name, attrs, connection):
+        if name == 'item':
+            att = Attachment()
+            self.attachments.append(att)
+            return att
+    
     def endElement(self, name, value, connection):
-        if name == 'snapshotId':
+        if name == 'vpnGatewayId':
             self.id = value
-        elif name == 'volumeId':
-            self.volume_id = value
-        elif name == 'startTime':
-            self.start_time = value
-        elif name == 'status':
-            self.status = value
+        elif name == 'type':
+            self.type = value
+        elif name == 'state':
+            self.state = value
+        elif name == 'availabilityZone':
+            self.availability_zone = value
+        elif name == 'attachments':
+            pass
         else:
             setattr(self, name, value)
 
-    def _update(self, updated):
-        self.progress = updated.progress
-
-    def update(self):
-        rs = self.connection.get_all_snapshots([self.id])
-        if len(rs) > 0:
-            self._update(rs[0])
-        return self.progress
-    
-    def delete(self):
-        return self.connection.delete_snapshot(self.id)
-
-
+    def attach(self, vpc_id):
+        return self.connection.attach_vpn_gateway(self.id, vpc_id)
 

Copied: incubator/mesos/trunk/third_party/boto-1.9b/cq.py (from r1132066, incubator/mesos/trunk/third_party/boto-1.8d/cq.py)
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/cq.py?p2=incubator/mesos/trunk/third_party/boto-1.9b/cq.py&p1=incubator/mesos/trunk/third_party/boto-1.8d/cq.py&r1=1132066&r2=1132067&rev=1132067&view=diff
==============================================================================
    (empty)

Added: incubator/mesos/trunk/third_party/boto-1.9b/docs/fabfile.py
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/docs/fabfile.py?rev=1132067&view=auto
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.9b/docs/fabfile.py (added)
+++ incubator/mesos/trunk/third_party/boto-1.9b/docs/fabfile.py Sun Jun  5 08:34:02 2011
@@ -0,0 +1,33 @@
+from fabric.operations import sudo, local, put
+
+def deploy(**kwargs):
+    remote_path = '/var/www'
+    if kwargs.get('remote_path', None):
+        remote_path = kwargs['remote_path']
+    
+    # Update
+    local("svn up ../")
+    rev = local("svn info | grep Revision")
+    rev = rev.replace("Revision: ", "").strip()
+    conf = open('source/conf-orig.py', 'r+b').read() 
+    open('source/conf.py', 'w+b').write(conf.replace('release = "HEAD"', 'release = "%s"' % rev))
+    tmp_folder_name = 'boto-docs.r%s' % rev
+    archive_name = '%s.tar.gz' % tmp_folder_name
+    
+    # Clean
+    local("rm -rf %s" % tmp_folder_name)
+    local("rm -f %s" % archive_name)
+    
+    # Build
+    local("make html")
+    local("mv build/html %s" % tmp_folder_name)
+    local("tar zcf %s %s" % (archive_name, tmp_folder_name))
+    
+    # Deploy
+    put(archive_name, '~/')
+    sudo("rm -f %s/%s && mv ~/%s %s/%s" % (remote_path, archive_name, archive_name, remote_path, archive_name))
+    sudo("cd %s && rm -rf %s && tar zxf %s" % (remote_path, tmp_folder_name, archive_name))
+    sudo("cd %s && rm -f boto-docs && ln -s %s boto-docs" % (remote_path, tmp_folder_name))
+    
+    # Validate
+    sudo("ls -al %s" % remote_path)
\ No newline at end of file

Added: incubator/mesos/trunk/third_party/boto-1.9b/docs/make.bat
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/boto-1.9b/docs/make.bat?rev=1132067&view=auto
==============================================================================
--- incubator/mesos/trunk/third_party/boto-1.9b/docs/make.bat (added)
+++ incubator/mesos/trunk/third_party/boto-1.9b/docs/make.bat Sun Jun  5 08:34:02 2011
@@ -0,0 +1,113 @@
+@ECHO OFF
+
+REM Command file for Sphinx documentation
+
+set SPHINXBUILD=sphinx-build
+set BUILDDIR=build
+set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
+if NOT "%PAPER%" == "" (
+	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+	:help
+	echo.Please use `make ^<target^>` where ^<target^> is one of
+	echo.  html      to make standalone HTML files
+	echo.  dirhtml   to make HTML files named index.html in directories
+	echo.  pickle    to make pickle files
+	echo.  json      to make JSON files
+	echo.  htmlhelp  to make HTML files and a HTML help project
+	echo.  qthelp    to make HTML files and a qthelp project
+	echo.  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+	echo.  changes   to make an overview over all changed/added/deprecated items
+	echo.  linkcheck to check all external links for integrity
+	echo.  doctest   to run all doctests embedded in the documentation if enabled
+	goto end
+)
+
+if "%1" == "clean" (
+	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
+	del /q /s %BUILDDIR%\*
+	goto end
+)
+
+if "%1" == "html" (
+	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+	goto end
+)
+
+if "%1" == "dirhtml" (
+	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+	goto end
+)
+
+if "%1" == "pickle" (
+	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+	echo.
+	echo.Build finished; now you can process the pickle files.
+	goto end
+)
+
+if "%1" == "json" (
+	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+	echo.
+	echo.Build finished; now you can process the JSON files.
+	goto end
+)
+
+if "%1" == "htmlhelp" (
+	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+	echo.
+	echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in %BUILDDIR%/htmlhelp.
+	goto end
+)
+
+if "%1" == "qthelp" (
+	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+	echo.
+	echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\boto.qhcp
+	echo.To view the help file:
+	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\boto.ghc
+	goto end
+)
+
+if "%1" == "latex" (
+	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+	echo.
+	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+	goto end
+)
+
+if "%1" == "changes" (
+	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+	echo.
+	echo.The overview file is in %BUILDDIR%/changes.
+	goto end
+)
+
+if "%1" == "linkcheck" (
+	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+	echo.
+	echo.Link check complete; look for any errors in the above output ^
+or in %BUILDDIR%/linkcheck/output.txt.
+	goto end
+)
+
+if "%1" == "doctest" (
+	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
+	echo.
+	echo.Testing of doctests in the sources finished, look at the ^
+results in %BUILDDIR%/doctest/output.txt.
+	goto end
+)
+
+:end



Mime
View raw message