Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git://github.com/s3tools/s3cmd

  • Loading branch information...
commit 9ea27801ce873402610b237b2dcc2f86acb8f47b 2 parents 1eaad64 + 23d133a
@mdomsch authored
Showing with 15 additions and 12 deletions.
  1. +9 −1 S3/CloudFront.py
  2. +6 −11 S3/FileLists.py
View
10 S3/CloudFront.py
@@ -555,8 +555,16 @@ def get_dist_name_for_bucket(self, uri):
for d in response['dist_list'].dist_summs:
if d.info.has_key("S3Origin"):
CloudFront.dist_list[getBucketFromHostname(d.info['S3Origin']['DNSName'])[0]] = d.uri()
+ elif d.info.has_key("CustomOrigin"):
+ # Aral: This used to skip over distributions with CustomOrigin, however, we mustn't
+ # do this since S3 buckets that are set up as websites use custom origins.
+ # Thankfully, the custom origin URLs they use start with the URL of the
+ # S3 bucket. Here, we make use this naming convention to support this use case.
+ distListIndex = getBucketFromHostname(d.info['CustomOrigin']['DNSName'])[0];
+ distListIndex = distListIndex[:len(uri.bucket())]
+ CloudFront.dist_list[distListIndex] = d.uri()
else:
- # Skip over distributions with CustomOrigin
+ # Aral: I'm not sure when this condition will be reached, but keeping it in there.
continue
debug("dist_list: %s" % CloudFront.dist_list)
try:
View
17 S3/FileLists.py
@@ -25,19 +25,13 @@ def _fswalk_follow_symlinks(path):
If a recursive directory link is detected, emit a warning and skip.
'''
assert os.path.isdir(path) # only designed for directory argument
- walkdirs = set([path])
- targets = set()
+ walkdirs = [path]
for dirpath, dirnames, filenames in os.walk(path):
handle_exclude_include_walk(dirpath, dirnames, [])
for dirname in dirnames:
current = os.path.join(dirpath, dirname)
- target = os.path.realpath(current)
if os.path.islink(current):
- if target in targets:
- warning("Skipping recursively symlinked directory %s" % dirname)
- else:
- walkdirs.add(current)
- targets.add(target)
+ walkdirs.append(current)
for walkdir in walkdirs:
for dirpath, dirnames, filenames in os.walk(walkdir):
handle_exclude_include_walk(dirpath, dirnames, [])
@@ -365,9 +359,10 @@ def __direction_str(is_remote):
## Check MD5
compare_md5 = 'md5' in cfg.sync_checks
# Multipart-uploaded files don't have a valid MD5 sum - it ends with "...-NN"
- if compare_md5 and (src_remote == True and src_list[file]['md5'].find("-") >= 0) or (dst_remote == True and dst_list[file]['md5'].find("-") >= 0):
- compare_md5 = False
- info(u"Disabled MD5 check for %s" % file)
+ if compare_md5:
+ if (src_remote == True and src_list[file]['md5'].find("-") >= 0) or (dst_remote == True and dst_list[file]['md5'].find("-") >= 0):
+ compare_md5 = False
+ info(u"Disabled MD5 check for %s" % file)
if attribs_match and compare_md5:
try:
if src_remote == False and dst_remote == True:
Please sign in to comment.
Something went wrong with that request. Please try again.