Skip to content

Commit

Permalink
Template Parameters Bug (#156)
Browse files Browse the repository at this point in the history
* converted vhd parameters to camel case to match what aosm expects

* markups + fixed apiVersion

---------

Co-authored-by: Jordan <jordan.layton@metaswitch.com>
  • Loading branch information
jordlay and Jordan authored Mar 11, 2024
1 parent af1730b commit f61cc99
Showing 1 changed file with 13 additions and 2 deletions.
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)

0 comments on commit f61cc99

Please sign in to comment.