1 Star 1 Fork 16

zhangxingrong/fence-agents

forked from src-openEuler/fence-agents 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-fence_azure-fix-pinning-client-api-versions-for-compatibility-across-different-azure-sdk-versions.patch 2.57 KB
一键复制 编辑 原始数据 按行查看 历史
zhangxingrong 提交于 2024-07-09 13:40 . add some upstream patchs
From 40a71a94e80da3bfce2607aaa584d57183cbaa35 Mon Sep 17 00:00:00 2001
From: devanshjain <devanshjain@microsoft.com>
Date: Thu, 13 Jun 2024 18:00:49 +0000
Subject: [PATCH] fence_azure: fix pinning client api versions for
compatibility across different azure sdk versions
---
lib/azure_fence.py.py | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/lib/azure_fence.py.py b/lib/azure_fence.py.py
index fcbc40ab0..5b26bd346 100644
--- a/lib/azure_fence.py.py
+++ b/lib/azure_fence.py.py
@@ -14,6 +14,8 @@
IP_TYPE_DYNAMIC = "Dynamic"
MAX_RETRY = 10
RETRY_WAIT = 5
+COMPUTE_CLIENT_API_VERSION = "2021-11-01"
+NETWORK_MGMT_CLIENT_API_VERSION = "2021-05-01"
class AzureSubResource:
Type = None
@@ -366,17 +368,20 @@ def get_azure_compute_client(config):
base_url=cloud_environment.endpoints.resource_manager,
profile=client_profile,
credential_scopes=[credential_scope],
+ api_version=COMPUTE_CLIENT_API_VERSION
)
except TypeError:
compute_client = ComputeManagementClient(
credentials,
config.SubscriptionId,
- base_url=cloud_environment.endpoints.resource_manager
+ base_url=cloud_environment.endpoints.resource_manager,
+ api_version=COMPUTE_CLIENT_API_VERSION
)
else:
compute_client = ComputeManagementClient(
credentials,
- config.SubscriptionId
+ config.SubscriptionId,
+ api_version=COMPUTE_CLIENT_API_VERSION
)
return compute_client
@@ -404,16 +409,19 @@ def get_azure_network_client(config):
base_url=cloud_environment.endpoints.resource_manager,
profile=client_profile,
credential_scopes=[credential_scope],
+ api_version=NETWORK_MGMT_CLIENT_API_VERSION
)
except TypeError:
network_client = NetworkManagementClient(
credentials,
config.SubscriptionId,
- base_url=cloud_environment.endpoints.resource_manager
+ base_url=cloud_environment.endpoints.resource_manager,
+ api_version=NETWORK_MGMT_CLIENT_API_VERSION
)
else:
network_client = NetworkManagementClient(
credentials,
- config.SubscriptionId
+ config.SubscriptionId,
+ api_version=NETWORK_MGMT_CLIENT_API_VERSION
)
return network_client
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangxingrong/fence-agents.git
git@gitee.com:zhangxingrong/fence-agents.git
zhangxingrong
fence-agents
fence-agents
master

搜索帮助