Permalink
Browse files

Whitespace problem: 2 vs 4 spaces...

Merge remote-tracking branch 'louisrli/master'

Conflicts:
	s3.py
  • Loading branch information...
2 parents df45aaa + 18e4f58 commit 4218d079e095f1d0fe3777d7eb860d65e6ce0855 @jbraeuer jbraeuer committed Jun 30, 2012
Showing with 13 additions and 9 deletions.
  1. +13 −9 s3.py
View
22 s3.py
@@ -133,9 +133,11 @@ def _handle_baseurl(self, baseurl):
if type(baseurl) == list:
baseurl = baseurl[0]
+ # self.baseurl[1] is self.baseurl.netloc; self.baseurl[2] is self.baseurl.path
+ # See http://docs.python.org/library/urlparse.html
self.baseurl = urlparse(baseurl)
- self.bucket_name = re.match('(.*)\.s3.*\.amazonaws\.com', self.baseurl.netloc).group(1)
- self.key_prefix = self.baseurl.path[1:]
+ self.bucket_name = re.match('(.*)\.s3.*\.amazonaws\.com', self.baseurl[1]).group(1)
+ self.key_prefix = self.baseurl[2][1:]
def _handle_s3(self, awsAccessKey, awsSecretKey):
self.s3 = boto.connect_s3(awsAccessKey, awsSecretKey)
@@ -195,11 +197,12 @@ def urlread(self, url, limit=None, **kwargs):
def createGrabber():
logger = logging.getLogger("yum.verbose.main")
try:
- grabber = createBotoGrabber()
- logger.debug("Using BotoGrabber")
- except:
- grabber = createUrllibGrabber()
- logger.debug("Using UrllibGrabber")
+ try:
+ grabber = createBotoGrabber()
+ logger.debug("Using BotoGrabber")
+ except:
+ grabber = createUrllibGrabber()
+ logger.debug("Using UrllibGrabber")
finally:
return grabber
@@ -254,7 +257,6 @@ def init_hook(conduit):
new_repo.name = repo.name
new_repo.baseurl = repo.baseurl
new_repo.mirrorlist = repo.mirrorlist
- new_repo.base_persistdir = repo.base_persistdir
new_repo.basecachedir = repo.basecachedir
new_repo.gpgcheck = repo.gpgcheck
new_repo.gpgkey = repo.gpgkey
@@ -263,7 +265,9 @@ def init_hook(conduit):
new_repo.key_id = repo.key_id
new_repo.secret_key = repo.secret_key
if hasattr(repo, 'priority'):
- new_repo.priority = repo.priority
+ new_repo.priority = repo.priority
+ if hasattr(repo, 'base_persistdir'):
+ new_repo.base_persistdir = repo.base_persistdir
repos.delete(repo.id)
repos.add(new_repo)

0 comments on commit 4218d07

Please sign in to comment.