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

Validate step not working in version 1.4.0 #67

Closed
ed-rw opened this issue Feb 7, 2022 · 2 comments
Closed

Validate step not working in version 1.4.0 #67

ed-rw opened this issue Feb 7, 2022 · 2 comments

Comments

@ed-rw
Copy link

ed-rw commented Feb 7, 2022

The validate step fails for all polices with an error message of check_deprecations for manheim-c7n-tools version 1.4.0.

It appears that deprecation framework added in cloud custodian version 0.9.13 wants an attribute check_deprecations added to the object passed to the validate function. Without that attribute existing, this line causes an AttributeError that is then reported as making the policy invalid.

This could possibly be viewed as an issue with cloud custodian itself, as the check_deprecations attribute may have been needed to be included as part of an empty config here.

I've fixed the issue by adding check_deprecations="yes" to the instantiation of the config for the ValidateStep here.

For others encountering this issue, you can use this invocation of the docker container to add the necessary attribute to the Config object passed to validate:

docker run -it --rm -v $(pwd):/configs --workdir /configs 
  -e "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" \
  -e "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" \
  -e "AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN" \  
  manheim/manheim-c7n-tools:1.4.0 \
  bash -c "sed -i '/conf = Config.empty($/ s/$/check_deprecations=\"yes\",/' /manheim_c7n_tools/manheim_c7n_tools/runner.py; manheim-c7n-runner ..."
@jleopold28
Copy link
Contributor

This should be resolved by #69. The latest release (1.4.1) will have the fix

@ed-rw
Copy link
Author

ed-rw commented Feb 10, 2022

Sweet! I have confirmed that using version 1.4.1 fixes this issue for us. Thanks for the quick responses @jleopold28 and @vincentclee !

@ed-rw ed-rw closed this as completed Feb 10, 2022
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

2 participants