manheim / manheim-c7n-tools

Manheim's Cloud Custodian (c7n) wrapper package, policy generator, runner, and supporting tools.
https://manheim-c7n-tools.readthedocs.io/
Apache License 2.0
45 stars 25 forks source link

step=custodian fails when there are 0 policies #55

Open IngussNeilands opened 4 years ago

IngussNeilands commented 4 years ago

I am runing account cleanup with step=mugc and 0 policies, and step=custodian fails with error message:

2020-08-12 12:30:21,058 [DEBUG commands.py:84 - custodian.commands._load_policies() ] Loaded file custodian_us-east-1.yml. Contains 0 policies
Traceback (most recent call last):
  File ".............../.virtualenv/lib/python3.8/site-packages/c7n/config.py", line 23, in __getattr__
    return self[k]
KeyError: 'policy_filters'

File custodian_us-east-1.yml contents are empty, as expected during automated account cleanup:

policies: []

Expected behaviour: step=custodian successfully runs with message 0 policies and no actions performed