Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hsz1273327 committed Jul 28, 2021
1 parent 1043a1b commit c5ef11b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 22 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## 接口修改

+ 新增全局flag`not_verify`用于跳过https的验证
+ 子命令`updateservicebywebhook``tokens`参数现在是位置参数
+ 子命令`updateservicebywebhook`现在可以用执行目录下的`update_service_by_webhooks_config.json`文件作为配置
+ 子命令`createorupdatestack``endpoints`参数现在是位置参数
Expand Down
6 changes: 1 addition & 5 deletions portainer_deploy_tool/create_or_update_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,7 @@ def do_main(self) -> None:
repository_password = self.config.get("repository_password")
retry_max_times = self.config.get("retry_max_times")
retry_interval_backoff_factor = self.config.get("retry_interval_backoff_factor")
not_verify = retry_interval_backoff_factor = self.config.get("not_verify")
if not_verify:
rq = requests.Session(verify=False)
else:
rq = requests.Session()
rq = requests.Session()
if retry_max_times and int(retry_max_times) > 0:
rq.mount('https://', HTTPAdapter(max_retries=Retry(total=int(retry_max_times), backoff_factor=retry_interval_backoff_factor, method_whitelist=frozenset(['GET', 'POST', 'PUT']))))
# 初始化log
Expand Down
6 changes: 1 addition & 5 deletions portainer_deploy_tool/update_service_by_webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ def do_main(self) -> None:
tokens = self.config["tokens"]
retry_max_times = self.config.get("retry_max_times")
retry_interval_backoff_factor = self.config.get("retry_interval_backoff_factor", 0)
not_verify = retry_interval_backoff_factor = self.config.get("not_verify")
if not_verify:
rq = requests.Session(verify=False)
else:
rq = requests.Session()
rq = requests.Session()
if retry_max_times and int(retry_max_times) > 0:
rq.mount('https://', HTTPAdapter(max_retries=Retry(total=int(retry_max_times), backoff_factor=retry_interval_backoff_factor, method_whitelist=frozenset(['GET', 'POST', 'PUT']))))
log.initialize_for_app(app_name="UpdateStack", log_level=log_level)
Expand Down
6 changes: 1 addition & 5 deletions portainer_deploy_tool/update_service_in_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,7 @@ def do_main(self) -> None:
deploy_path = self.config["deploy_path"]
retry_max_times = self.config.get("retry_max_times")
retry_interval_backoff_factor = self.config.get("retry_interval_backoff_factor")
not_verify = retry_interval_backoff_factor = self.config.get("not_verify")
if not_verify:
rq = requests.Session(verify=False)
else:
rq = requests.Session()
rq = requests.Session()
if retry_max_times and int(retry_max_times) > 0:
rq.mount('https://', HTTPAdapter(max_retries=Retry(total=int(retry_max_times), backoff_factor=retry_interval_backoff_factor, method_whitelist=frozenset(['GET', 'POST', 'PUT']))))
log.initialize_for_app(app_name="UpdateStack", log_level=log_level)
Expand Down
7 changes: 1 addition & 6 deletions portainer_deploy_tool/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@
"type": "number",
"description": "重试间隔时间,的参数,间隔时间位`{backoff factor} * (2 ** ({number of total retries} - 1))`",
"default": 0.1
},
"not_verify": {
"type": "boolean",
"description": "是否不验证ssl",
"default": False
},
}
}


Expand Down

0 comments on commit c5ef11b

Please sign in to comment.