Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template Parameters Bug #156

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/aosm/azext_aosm/inputs/vhd_file_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import Any, Dict, Optional

from knack.log import get_logger

from azext_aosm.common.utils import snake_case_to_camel_case
from azext_aosm.common.constants import BASE_SCHEMA
from azext_aosm.inputs.base_input import BaseInput

Expand Down Expand Up @@ -43,6 +43,17 @@ def __init__(
self.file_path = file_path
self.blob_sas_uri = blob_sas_uri

formatted_config = {}
for (key, value) in self.default_config.items():
# This must be an integer, but is a string in the input file
if key == "image_disk_size_GB":
value = int(value)
if key == "image_api_version":
key = "apiVersion"
formatted_key = snake_case_to_camel_case(key)
formatted_config[formatted_key] = value
self.default_config = formatted_config

def get_defaults(self) -> Dict[str, Any]:
"""
Gets the default values for configuring the input.
Expand Down Expand Up @@ -81,4 +92,4 @@ def get_schema(self) -> Dict[str, Any]:
schema["required"] += vhd_required

logger.debug("Schema for VHD file input: %s", json.dumps(schema, indent=4))
return copy.deepcopy(schema)
return copy.deepcopy(schema)