Repository: cloud-custodian/cloud-custodian

Issue:
Schema tightening appears to have broken execution-options
Suspect regression similar to #1662 as when attempting to validate a previously working mode: periodic policy where only change was adding the following execution option to disable metrics per http://www.capitalone.io/cloud-custodian/docs/policy/lambda.html
```
    execution-options:
        metrics_enabled: false
```
now get the following error:
```
2017-10-27 03:21:48,569: custodian.commands:ERROR Additional properties are not allowed ('execution-options' was unexpected)

Failed validating u'additionalProperties' in schema[28][u'allOf'][0][u'properties'][u'mode']:
    {u'additionalProperties': False,
     u'properties': {u'dead_letter_config': {u'type': u'object'},
                     u'environment': {u'type': u'object'},
                     u'events': {u'items': {u'oneOf': [{u'type': u'string'},
                                                       {u'properties': {u'event': {u'type': u'string'},
                                                                        u'ids': {u'type': u'string'},
                                                                        u'source': {u'type': u'string'}},
                                                        u'required': [u'event',
                                                                      u'source',
                                                                      u'ids'],
                                                        u'type': u'object'}]},
                                 u'type': u'array'},
                     u'kms_key_arn': {u'type': u'string'},
                     u'memory': {u'type': u'number'},
                     u'role': {u'type': u'string'},
                     u'runtime': {u'enum': [u'python2.7', u'python3.6']},
                     u'schedule': {u'type': u'string'},
                     u'tags': {u'type': u'object'},
                     u'timeout': {u'type': u'number'},
                     u'tracing_config': {u'type': u'object'},
                     u'type': {u'enum': [u'cloudtrail',
                                         u'ec2-instance-state',
                                         u'asg-instance-state',
                                         u'config-rule',
                                         u'periodic']}},
     u'required': [u'type'],
     u'type': u'object'}

On instance[u'mode']:
    {'execution-options': {'metrics_enabled': False},
     'role': 'arn:aws:iam::{account_id}:role/lambda-cloudcustodian',
     'schedule': 'cron(0,30 * ? * * *)',
     'type': 'periodic'}
2017-10-27 03:21:48,569: custodian.commands:ERROR ec2-terminate-marked
```


Discussion:

Resolving patch:
diff --git a/c7n/schema.py b/c7n/schema.py
--- a/c7n/schema.py
+++ b/c7n/schema.py
@@ -205,7 +205,7 @@ def generate(resource_types=()):
                              'ids': {'type': 'string'},
                              'event': {'type': 'string'}}}],
                 }},
-
+                'execution-options': {'type': 'object'},
                 'role': {'type': 'string'},
                 'runtime': {'enum': ['python2.7', 'python3.6']},
                 'memory': {'type': 'number'},


Test patch:
diff --git a/tests/test_schema.py b/tests/test_schema.py
--- a/tests/test_schema.py
+++ b/tests/test_schema.py
@@ -291,6 +291,7 @@ def test_runtime(self):
                 'name': 'test',
                 'resource': 's3',
                 'mode': {
+                    'execution-options': {'metrics_enabled': False},
                     'type': 'periodic',
                     'schedule': 'xyz',
                     'runtime': runtime}}]