def configure(self):
        self.configure_bundle_upload_auth()

        WalrusRequest.configure(self)

        self.configure_bundle_creds()
        self.configure_bundle_properties()
        self.configure_bundle_output()
        self.generate_encryption_keys()
Example #2
0
 def configure(self):
     WalrusRequest.configure(self)
     if (self.args.get('literal_dest', False) and
         len(self.args['sources']) != 1):
         # Can't explicitly specify dest file names when we're uploading
         # more than one thing
         raise ArgumentError('argument -T: only allowed with one file')
     if self.args['dest'].startswith('/'):
         raise ArgumentError('destination must begin with a bucket name')
Example #3
0
 def configure(self):
     WalrusRequest.configure(self)
     if (self.args.get('literal_dest', False)
             and len(self.args['sources']) != 1):
         # Can't explicitly specify dest file names when we're uploading
         # more than one thing
         raise ArgumentError('argument -T: only allowed with one file')
     if self.args['dest'].startswith('/'):
         raise ArgumentError('destination must begin with a bucket name')
Example #4
0
 def configure(self):
     WalrusRequest.configure(self)
     for path in self.args["paths"]:
         if path.startswith("/"):
             raise ArgumentError(("argument '{0}' must not start with " '"/"; format is BUCKET[/KEY]').format(path))
         bucket = path.split("/", 1)[0]
         try:
             validate_generic_bucket_name(bucket)
         except ValueError as err:
             raise ArgumentError('bucket "{0}": {1}'.format(bucket, err.message))
Example #5
0
 def configure(self):
     WalrusRequest.configure(self)
     for path in self.args['paths']:
         if path.startswith('/'):
             raise ArgumentError((
                 'argument \'{0}\' must not start with '
                 '"/"; format is BUCKET[/KEY]').format(path))
         bucket = path.split('/', 1)[0]
         try:
             validate_generic_bucket_name(bucket)
         except ValueError as err:
             raise ArgumentError(
                 'bucket "{0}": {1}'.format(bucket, err.message))
Example #6
0
    def configure(self):
        WalrusRequest.configure(self)

        if self.args['source'] == '-':
            self.files['file'] = sys.stdin
        elif isinstance(self.args['source'], basestring):
            self.files['file'] = open(self.args['source'])
        else:
            self.files['file'] = self.args['source']
        bucket, _, key = self.args['dest'].partition('/')
        if not bucket:
            raise ArgumentError('destination bucket name must be non-empty')
        if not key:
            raise ArgumentError('destination key name must be non-empty')
Example #7
0
 def configure(self):
     WalrusRequest.configure(self)
     if self.args['source'] == '-':
         if self.args.get('size') is None:
             raise ArgumentError(
                 "argument --size is required when uploading stdin")
         source = _FileObjectExtent(sys.stdin, self.args['size'])
     elif isinstance(self.args['source'], basestring):
         source = _FileObjectExtent.from_filename(self.args['source'])
     else:
         if self.args.get('size') is None:
             raise ArgumentError(
                 "argument --size is required when uploading a file object")
         source = _FileObjectExtent(sys.stdin, self.args['size'])
     self.args['source'] = source
     bucket, _, key = self.args['dest'].partition('/')
     if not bucket:
         raise ArgumentError('destination bucket name must be non-empty')
     if not key:
         raise ArgumentError('destination key name must be non-empty')
Example #8
0
 def configure(self):
     WalrusRequest.configure(self)
     validate_generic_bucket_name(self.args['bucket'])
Example #9
0
 def configure(self):
     WalrusRequest.configure(self)
     validate_generic_bucket_name(self.args['bucket'])
Example #10
0
 def configure(self):
     WalrusRequest.configure(self)
     for path in self.args['paths']:
         if '/' not in path:
             raise ArgumentError("path '{0}' must include a key name")
 def configure(self):
     WalrusRequest.configure(self)
     if self.args['numeric_output']:
         self.args['long_output'] = True
Example #12
0
 def configure(self):
     WalrusRequest.configure(self)
     if self.args['numeric_output']:
         self.args['long_output'] = True
Example #13
0
 def configure(self):
     self.configure_bundle_upload_auth()
     WalrusRequest.configure(self)
Example #14
0
 def __init__(self, **kwargs):
     WalrusRequest.__init__(self, **kwargs)
     self.last_upload_error = None
     self._lock = threading.Lock()
Example #15
0
 def __init__(self, **kwargs):
     WalrusRequest.__init__(self, **kwargs)
     self.last_upload_error = None
     self._lock = threading.Lock()