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

default lookup doesn't retain value type #654

Open
Spareo opened this issue Aug 31, 2018 · 2 comments
Open

default lookup doesn't retain value type #654

Spareo opened this issue Aug 31, 2018 · 2 comments

Comments

@Spareo
Copy link

Spareo commented Aug 31, 2018

I am passing in an environment file with the following line in it:

BaselineCapacity: 2

In my blueprint I have the following variable defined:

"BaselineCapacity": {
            "type": int,
            "description": "The number of instances to maintain during market close hours"
  },

And finally, in my config.yml I have the following under one of my stacks

BaselineCapacity: ${default BaselineCapacity::1}

When I run stacker build I get the following error:

Value for variable BaselineCapacity must be of type <type 'int'>. Actual type: <type 'str'>.
@phobologic
Copy link
Member

Hey @Spareo - thanks for the bug report. @troyready - not sure what the best way would be to deal with this. I'm wondering if we should have a cast lookup that can cast values as different types.

Another option is to make it so default knows the type of the variable and automatically tries to cast it correctly, though that would be a much deeper change.

@troyready
Copy link
Contributor

I like the cast idea. Would meet the need here in a simple way, and could always be cast off (pun not intended) in the future if it was made irrelevant.

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

No branches or pull requests

3 participants