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

Template Parameters Bug #156

merged 2 commits into from
Mar 11, 2024

Conversation

jordlay
Copy link
Collaborator

@jordlay jordlay commented Mar 11, 2024


We need to convert our vhd parameters to camel case, so that it doesn't fail on the SNS put.

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

@jordlay jordlay requested a review from sunnycarter as a code owner March 11, 2024 14:50
Comment on lines 86 to 96

def _format_default_config(self):
print(self.default_config)
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)
formatted_key = snake_case_to_camel_case(key)
formatted_config[formatted_key] = value
return formatted_config
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not easier to do all this in the init(), perhaps like this:

         if "image_disk_size_GB" in self.default_config:
             self.default_config["imageDiskSizeGB"] = int(self.default_config["image_disk_size_GB"])
             del self.default_config["image_disk_size_GB"]

(and if we know we always have image_disk_size_GB, then we don't need the if statement)
(and if it doesn't matter if the old value sticks around, don't need the del either)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont always have disk size + i like having a separate dict returned so we dont have to worry about deleting things

@jordlay jordlay merged commit f61cc99 into main Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants