Skip to content

Commit 4ea447d

Browse files
authored
Merge pull request #260 from l-iberty/master
rm some comments
2 parents c58dbe6 + 30d817b commit 4ea447d

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

qcloud_cos/cos_client.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def __init__(self, Appid=None, Region=None, SecretId=None, SecretKey=None, Token
7575
:param EnableOldDomain(bool): 是否使用旧的myqcloud.com域名访问COS
7676
:param EnableInternalDomain(bool): 是否使用内网域名访问COS
7777
:param SignParams(bool): 是否将请求参数算入签名
78-
:param AutoSwitchDomainOnRetry(bool): 重试请求时是否自动切换域名
7978
"""
8079
self._appid = to_unicode(Appid)
8180
self._token = to_unicode(Token)
@@ -381,11 +380,8 @@ def send_request(self, method, url, bucket, timeout=30, cos_request=True, ci_req
381380
else:
382381
if j < self._retry and client_can_retry(file_position, **kwargs):
383382
if not domain_switched and self._conf._auto_switch_domain_on_retry and self._conf._ip is None:
384-
# 重试时切换域名
385-
logger.debug("switch hostname, url before: " + url)
386383
url = switch_hostname_for_url(url)
387384
domain_switched = True
388-
logger.debug("switch hostname, url after: " + url)
389385
continue
390386
else:
391387
break
@@ -394,11 +390,8 @@ def send_request(self, method, url, bucket, timeout=30, cos_request=True, ci_req
394390
if j < self._retry and (isinstance(e, ConnectionError) or isinstance(e, Timeout)): # 只重试网络错误
395391
if client_can_retry(file_position, **kwargs):
396392
if not domain_switched and self._conf._auto_switch_domain_on_retry and self._conf._ip is None:
397-
# 重试时切换域名
398-
logger.debug("switch hostname, url before: " + url)
399393
url = switch_hostname_for_url(url)
400394
domain_switched = True
401-
logger.debug("switch hostname, url after: " + url)
402395
continue
403396
raise CosClientError(str(e))
404397

qcloud_cos/cos_comm.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ def format_endpoint(endpoint, region, module, EnableOldDomain, EnableInternalDom
245245
return None
246246

247247
def switch_hostname(host):
248-
"""将cos默认域名的.myqcloud.com后缀替换为.tencentcos.cn"""
249248
if not host:
250249
raise CosClientError("Host is required not empty!")
251250

@@ -267,7 +266,6 @@ def switch_hostname_for_url(url):
267266
new_url = url.replace(host, new_host)
268267
return new_url
269268

270-
"""返回原始url"""
271269
return url
272270

273271

0 commit comments

Comments
 (0)