From 450e61655ff857351fc70dd4ae444709bcf705ea Mon Sep 17 00:00:00 2001 From: alex-smile <443677891@qq.com> Date: Sat, 1 Jul 2023 15:40:29 +0800 Subject: [PATCH] Fix iam migrator app (#85) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * set require cachetools>=3.1.1,<6.0 in setup.py * 将 bk_app_code/bk_app_secret 设置为 IAMMigrator 的实例属性 * 更新 release 信息及版本号 --- iam/__version__.py | 2 +- iam/contrib/iam_migration/migrator.py | 7 +++---- readme.md | 2 +- readme_en.md | 2 +- release.md | 5 +++++ 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/iam/__version__.py b/iam/__version__.py index 4aaabba..4c1d823 100644 --- a/iam/__version__.py +++ b/iam/__version__.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -__version__ = "1.3.3" +__version__ = "1.3.4" diff --git a/iam/contrib/iam_migration/migrator.py b/iam/contrib/iam_migration/migrator.py index 04f3cb6..386235d 100644 --- a/iam/contrib/iam_migration/migrator.py +++ b/iam/contrib/iam_migration/migrator.py @@ -34,11 +34,10 @@ def upsert_system_render(data): class IAMMigrator(object): def __init__(self, migration_json): self.migration_json = migration_json + self._bk_app_code = getattr(settings, "APP_CODE", "") + self._bk_app_secret = settings.SECRET_KEY def migrate(self): - app_code = settings.APP_CODE - app_secret = settings.SECRET_KEY - iam_host = "" USE_APIGATEWAY = getattr(settings, "BK_IAM_USE_APIGATEWAY", False) if USE_APIGATEWAY: @@ -71,6 +70,6 @@ def migrate(self): if not ok: raise exceptions.NetworkUnreachableError("bk iam ping error") - ok = do_migrate.do_migrate(data, iam_host, app_code, app_secret) + ok = do_migrate.do_migrate(data, iam_host, self._bk_app_code, self._bk_app_secret) if not ok: raise exceptions.MigrationFailError("iam migrate fail") diff --git a/readme.md b/readme.md index 0c9b572..58eccd0 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@ ![](docs/resource/img/bk_iam_zh.png) --- -[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/TencentBlueKing/iam-python-sdk/blob/master/LICENSE.txt) [![Release Version](https://img.shields.io/badge/release-1.3.2-brightgreen.svg)](https://github.com/TencentBlueKing/iam-python-sdk/releases) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/TencentBlueKing/iam-python-sdk/pulls) [![BK Pipelines Status](https://api.bkdevops.qq.com/process/api/external/pipelines/projects/iam/p-5c359e750bb9457984ab84656651d843/badge?X-DEVOPS-PROJECT-ID=iam)](http://devops.oa.com/process/api-html/user/builds/projects/iam/pipelines/p-5c359e750bb9457984ab84656651d843/latestFinished?X-DEVOPS-PROJECT-ID=iam) +[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/TencentBlueKing/iam-python-sdk/blob/master/LICENSE.txt) [![Release Version](https://img.shields.io/badge/release-1.3.4-brightgreen.svg)](https://github.com/TencentBlueKing/iam-python-sdk/releases) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/TencentBlueKing/iam-python-sdk/pulls) [![BK Pipelines Status](https://api.bkdevops.qq.com/process/api/external/pipelines/projects/iam/p-5c359e750bb9457984ab84656651d843/badge?X-DEVOPS-PROJECT-ID=iam)](http://devops.oa.com/process/api-html/user/builds/projects/iam/pipelines/p-5c359e750bb9457984ab84656651d843/latestFinished?X-DEVOPS-PROJECT-ID=iam) [(English Documents Available)](readme_en.md) diff --git a/readme_en.md b/readme_en.md index 3267296..0fc83e1 100644 --- a/readme_en.md +++ b/readme_en.md @@ -1,7 +1,7 @@ ![](docs/resource/img/bk_iam_en.png) --- -[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/TencentBlueKing/iam-python-sdk/blob/master/LICENSE.txt) [![Release Version](https://img.shields.io/badge/release-1.3.2-brightgreen.svg)](https://github.com/TencentBlueKing/iam-python-sdk/releases) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/TencentBlueKing/iam-python-sdk/pulls) [![BK Pipelines Status](https://api.bkdevops.qq.com/process/api/external/pipelines/projects/iam/p-5c359e750bb9457984ab84656651d843/badge?X-DEVOPS-PROJECT-ID=iam)](http://devops.oa.com/process/api-html/user/builds/projects/iam/pipelines/p-5c359e750bb9457984ab84656651d843/latestFinished?X-DEVOPS-PROJECT-ID=iam) +[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/TencentBlueKing/iam-python-sdk/blob/master/LICENSE.txt) [![Release Version](https://img.shields.io/badge/release-1.3.4-brightgreen.svg)](https://github.com/TencentBlueKing/iam-python-sdk/releases) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/TencentBlueKing/iam-python-sdk/pulls) [![BK Pipelines Status](https://api.bkdevops.qq.com/process/api/external/pipelines/projects/iam/p-5c359e750bb9457984ab84656651d843/badge?X-DEVOPS-PROJECT-ID=iam)](http://devops.oa.com/process/api-html/user/builds/projects/iam/pipelines/p-5c359e750bb9457984ab84656651d843/latestFinished?X-DEVOPS-PROJECT-ID=iam) ## Overview diff --git a/release.md b/release.md index 8002d2a..ae5e45a 100644 --- a/release.md +++ b/release.md @@ -1,6 +1,11 @@ 版本日志 =============== +# v1.3.4 + +- IAMMigrator 将 bk_app_code/bk_app_secret 设置为类实例属性 +- cachetools 依赖版本号调整为:cachetools>=3.1.1,<6.0 + # v1.3.3 - add: list_instance、search_instance 新增 action 返回