Skip to content

default lookup doesn't retain value type #654

Open

Description

@Spareo

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'>.

Activity

  1. phobologic commented on Sep 3, 2018

    @phobologic
    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.

  2. troyready commented on Sep 30, 2018

    @troyready
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions