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

[batch] Update required properties #1913

Merged
merged 1 commit into from
Jun 13, 2021
Merged

Conversation

@markpeek markpeek merged commit 958a0fc into cloudtools:master Jun 13, 2021
@markpeek
Copy link
Member

Thanks!

@michael-k michael-k deleted the batch branch June 13, 2021 12:48
@kumapo
Copy link
Contributor

kumapo commented Jul 7, 2021

@markpeek Do you have any plans to include this patch into v2?

@michael-k
Copy link
Contributor Author

@kumapo You can use patched versions in your code until you switch to v3:

from troposphere.batch import ComputeEnvironment, ContainerProperties


def _fix_required_props(parent, not_required):
    return {
        key: (value[0], False) if key in not_required else value
        for key, value in parent.props.items()
    }


class PatchedComputeEnvironment(ComputeEnvironment):
    props = _fix_required_props(ComputeEnvironment, not_required=["ServiceRole"])


class PatchedContainerProperties(ContainerProperties):
    props = _fix_required_props(ContainerProperties, not_required=["Memory", "Vcpus"])

PatchedComputeEnvironment and PatchedContainerProperties can be used anywhere where ComputeEnvironment/ContainerProperties can be used.

@kumapo
Copy link
Contributor

kumapo commented Jul 7, 2021

@michael-k Thank you for your advice! I will try it.

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.

None yet

3 participants