Skip to content

Commit 7857577

Browse files
authored
generate_sdk pin stable version (#16799)
1 parent 14eb6f7 commit 7857577

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
@@ -15,14 +15,15 @@ def autorest_latest_version_finder():
1515
return json.loads(subprocess.check_output(cmd_line.split()).decode().strip())
1616

1717

18-
def autorest_swagger_to_sdk_conf(readme, output_folder):
18+
def autorest_swagger_to_sdk_conf(readme, output_folder, config):
1919
_LOGGER.info("Looking for swagger-to-sdk section in {}".format(readme))
2020
autorest_bin = shutil.which("autorest")
2121
# --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)
22-
cmd_line = "{} {} --perform-load=false --swagger-to-sdk --output-artifact=configuration.json --input-file=foo --output-folder={}".format(
22+
cmd_line = "{} {} --perform-load=false --swagger-to-sdk --output-artifact=configuration.json --input-file=foo --output-folder={} --version={}".format(
2323
autorest_bin,
2424
str(readme),
25-
str(output_folder)
25+
str(output_folder),
26+
str(config['meta']['autorest_options']['version'])
2627
)
2728
execute_simple_command(cmd_line.split())
2829
conf_path = Path(output_folder, "configuration.json")

0 commit comments

Comments
 (0)