Skip to content

Commit 9999d28

Browse files
authored
generate_sdk pin stable version (Azure#16797)
1 parent 9cb1695 commit 9999d28

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tools/azure-sdk-tools/packaging_tools/swaggertosdk/SwaggerToSdkCore.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ def build_swaggertosdk_conf_from_json_readme(readme_file, sdk_git_id, config, ba
222222
with tempfile.TemporaryDirectory() as temp_dir:
223223
readme_as_conf = autorest_swagger_to_sdk_conf(
224224
readme_full_path,
225-
temp_dir
225+
temp_dir,
226+
config
226227
)
227228
generated_config = {
228229
"markdown": readme_full_path,

tools/azure-sdk-tools/packaging_tools/swaggertosdk/autorest_tools.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ def autorest_latest_version_finder():
1414
return json.loads(subprocess.check_output(cmd_line.split()).decode().strip())
1515

1616

17-
def autorest_swagger_to_sdk_conf(readme, output_folder):
17+
def autorest_swagger_to_sdk_conf(readme, output_folder, config):
1818
_LOGGER.info("Looking for swagger-to-sdk section in {}".format(readme))
1919
autorest_bin = shutil.which("autorest")
2020
# --input-file=foo is to workaround a bug where the command is not executed at all if no input-file is found (even if we don't care about input-file here)
21-
cmd_line = "{} {} --perform-load=false --swagger-to-sdk --output-artifact=configuration.json --input-file=foo --output-folder={}".format(
21+
cmd_line = "{} {} --perform-load=false --swagger-to-sdk --output-artifact=configuration.json --input-file=foo --output-folder={} --version={}".format(
2222
autorest_bin,
2323
str(readme),
24-
str(output_folder)
24+
str(output_folder),
25+
str(config['meta']['autorest_options']['version'])
2526
)
2627
execute_simple_command(cmd_line.split())
2728
conf_path = Path(output_folder, "configuration.json")

0 commit comments

Comments
 (0)