Skip to content

Commit

Permalink
update filepath (Azure#32713)
Browse files Browse the repository at this point in the history
  • Loading branch information
Netyyyy authored Dec 26, 2022
1 parent 5353a2f commit 41e2100
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions sdk/spring/scripts/compatibility_get_spring_cloud_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@


import os
import json
import argparse
import requests


def get_args():
Expand All @@ -24,8 +24,7 @@ def change_to_repo_root_dir():
def get_spring_cloud_version(filepath):
spring_boot_version = get_args().spring_boot_dependencies_version
spring_cloud_version = ""
with open(filepath, 'r') as file:
data = json.load(file)
data = requests.get(filepath).json()
for entry in data:
for key in entry:
if spring_boot_version == entry[key]:
Expand All @@ -36,7 +35,7 @@ def get_spring_cloud_version(filepath):

def main():
change_to_repo_root_dir()
get_spring_cloud_version("./sdk/spring/spring-cloud-azure-supported-spring.json")
get_spring_cloud_version("https://raw.githubusercontent.com/Azure/azure-sdk-for-java/main/sdk/spring/spring-cloud-azure-supported-spring.json")


if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import os
import json
import argparse
import requests


def get_args():
Expand Down Expand Up @@ -40,8 +41,7 @@ def update_supported_version_matrix_json_file(filepath, suppoerted_spring_boot_v

def get_supported_spring_boot_version(filepath):
supported_version_list = []
with open(filepath, 'r') as file:
data = json.load(file)
data = requests.get(filepath).json()
for entry in data:
for key in entry:
if entry[key] == "SUPPORTED":
Expand All @@ -54,7 +54,7 @@ def main():
start_time = time.time()
change_to_repo_root_dir()
log.debug('Current working directory = {}.'.format(os.getcwd()))
suppoerted_spring_boot_version = get_supported_spring_boot_version("./sdk/spring/spring-cloud-azure-supported-spring.json")
suppoerted_spring_boot_version = get_supported_spring_boot_version("https://raw.githubusercontent.com/Azure/azure-sdk-for-java/main/sdk/spring/spring-cloud-azure-supported-spring.json")
update_supported_version_matrix_json_file("./sdk/spring/supported-version-matrix.json", suppoerted_spring_boot_version)
elapsed_time = time.time() - start_time
log.info('elapsed_time = {}'.format(elapsed_time))
Expand Down

0 comments on commit 41e2100

Please sign in to comment.