[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Duplicity-talk] Minor fixups
From: |
Kenneth Loafman |
Subject: |
Re: [Duplicity-talk] Minor fixups |
Date: |
Sun, 15 Jul 2007 06:29:21 -0500 |
User-agent: |
Thunderbird 1.5.0.12 (X11/20070604) |
backends.py is in CVS now, with the patches applied.
...Ken
Kenneth Loafman wrote:
> I'll get these into the next RC. Thanks for the help!
>
> ...Ken
>
> Eric Evans wrote:
>> There is a flaw in the boto backends test of the required environment
>> variables, namely that it's performed after it's too late. Apparently I
>> never tested that. :/ Patch attached.
>>
>> There is also a problem with the string join in line that logs the file
>> names in the bucket. At least on my system (with Python 2.4 and 2.5
>> installed), the string module would need to be imported. I've also
>> attached a one-line patch that uses the built-in string objects join
>> method.
>>
>> Thanks,
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> boto_backend env var error handling
>>
>> diff -r a3e26eeb2a3d duplicity/backends.py
>> --- a/duplicity/backends.py Sat Jul 14 16:27:37 2007 +0000
>> +++ b/duplicity/backends.py Sat Jul 14 20:21:23 2007 -0500
>> @@ -503,19 +503,20 @@ class BotoBackend(Backend):
>> raise BackendException("This backend requires the boto
>> library, " \
>> "(http://code.google.com/p/boto/).")
>>
>> - self.key_class = Key
>> -
>> - self.conn = S3Connection()
>> - self.bucket_name = parsed_url.suffix
>> - self.bucket = self.conn.create_bucket(self.bucket_name)
>> -
>> if not (os.environ.has_key('AWS_ACCESS_KEY_ID') and
>> os.environ.has_key('AWS_SECRET_ACCESS_KEY')):
>> raise BackendException("The AWS_ACCESS_KEY_ID and " \
>> "AWS_SECRET_ACCESS_KEY environment variables
>> are not set.")
>>
>> + self.bucket_name = parsed_url.suffix
>> +
>> if '/' in self.bucket_name:
>> raise BackendException("Invalid bucket specification.")
>> +
>> + self.key_class = Key
>> +
>> + self.conn = S3Connection()
>> + self.bucket = self.conn.create_bucket(self.bucket_name)
>>
>> def put(self, source_path, remote_filename=None):
>> if not remote_filename:
>>
>>
>> ------------------------------------------------------------------------
>>
>> fix broken string join
>>
>> diff -r f4de73a32ec8 duplicity/backends.py
>> --- a/duplicity/backends.py Sat Jul 14 20:06:54 2007 -0500
>> +++ b/duplicity/backends.py Sat Jul 14 20:14:46 2007 -0500
>> @@ -535,7 +535,7 @@ class BotoBackend(Backend):
>>
>> def list(self):
>> filename_list = [k.key for k in self.bucket.get_all_keys()]
>> - log.Log("Files in bucket:\n%s" % string.join(filename_list,
>> '\n'), 9)
>> + log.Log("Files in bucket:\n%s" % '\n'.join(filename_list), 9)
>> return filename_list
>>
>> def delete(self, filename_list):
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Duplicity-talk mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/duplicity-talk
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Duplicity-talk mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/duplicity-talk
signature.asc
Description: OpenPGP digital signature