internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: cloudtools/troposphere

Issue:
Extend classes to add class params
It would be useful to allow one to create custom classes which inherit the validation logic from toposphere's but allow arbitrary properties to be set on the class. That way one can use a class hierarchy to reduce repetition of definitions in similar resources.



Discussion:
I'd say do it!


Resolving patch:
diff --git a/examples/ClassExtensions.py b/examples/ClassExtensions.py
new file mode 100644
--- /dev/null
+++ b/examples/ClassExtensions.py
@@ -0,0 +1,25 @@
+import troposphere
+import troposphere.ec2
+
+template = troposphere.Template()
+
+
+class TrustyInstance(troposphere.ec2.Instance):
+    ImageId = "ami-xxxx"
+    Monitoring = True
+
+
+class FrontendInstance(TrustyInstance):
+    SecurityGroups = ["frontend"]
+    InstanceType = "t1.micro"
+
+
+class ProcessingInstance(TrustyInstance):
+    SecurityGroups = ["processing"]
+    InstanceType = "m3.large"
+
+
+template.add_resource(FrontendInstance('jones1'))
+template.add_resource(ProcessingInstance('williams1', InstanceType="m2.large"))
+
+print(template.to_json())
diff --git a/troposphere/__init__.py b/troposphere/__init__.py
--- a/troposphere/__init__.py
+++ b/troposphere/__init__.py
@@ -55,6 +55,14 @@ def __init__(self, title, template=None, **kwargs):
             self.resource['Type'] = self.resource_type
         self.__initialized = True
 
+        for k, (_, required) in self.props.items():
+            v = getattr(type(self), k, None)
+            if v is not None and k not in kwargs:
+                if k in self.attributes:
+                    self.resource[k] = v
+                else:
+                    self.__setattr__(k, v)
+
         # Now that it is initialized, populate it with the kwargs
         for k, v in kwargs.items():
             # Special case Resource Attributes


Test patch:
diff --git a/tests/examples_output/ClassExtensions.template b/tests/examples_output/ClassExtensions.template
new file mode 100644
--- /dev/null
+++ b/tests/examples_output/ClassExtensions.template
@@ -0,0 +1,26 @@
+{
+    "Resources": {
+        "jones1": {
+            "Properties": {
+                "ImageId": "ami-xxxx",
+                "InstanceType": "t1.micro",
+                "Monitoring": "true",
+                "SecurityGroups": [
+                    "frontend"
+                ]
+            },
+            "Type": "AWS::EC2::Instance"
+        },
+        "williams1": {
+            "Properties": {
+                "ImageId": "ami-xxxx",
+                "InstanceType": "m2.large",
+                "Monitoring": "true",
+                "SecurityGroups": [
+                    "processing"
+                ]
+            },
+            "Type": "AWS::EC2::Instance"
+        }
+    }
+}
Repository: cloudtools/troposphere

Issue:
RDS ValueError on LicenseModel
I'm hitting a similar problem to #316, Postgres instances only use the string `'postgresql-license'` for the LicenseModel parameter and I'm getting a ValueError:

```
ValueError: DBInstance LicenseModel must be one of: license-included, bring-your-own-license, general-public-license
```

I could not find the `postgresql-license` in any API documentation, but it is in the [user-guide](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreatePostgreSQLInstance.html)



Discussion:

Resolving patch:
diff --git a/troposphere/rds.py b/troposphere/rds.py
--- a/troposphere/rds.py
+++ b/troposphere/rds.py
@@ -16,7 +16,7 @@
                     'sqlserver-ee', 'sqlserver-se', 'sqlserver-ex',
                     'sqlserver-web', 'postgres')
 VALID_LICENSE_MODELS = ('license-included', 'bring-your-own-license',
-                        'general-public-license')
+                        'general-public-license', 'postgresql-license')
 
 
 def validate_iops(iops):


Test patch:
Repository: cloudtools/troposphere

Issue:
Validation of AutoScalingGroup with UpdatePolicy fails when maxSize is an expression
Troposphere version: `troposphere==1.5.0`
Snippet example:

```
t.add_resource(AutoScalingGroup(
        "WebserverAutoScalingGroup",
        AvailabilityZones=GetAZs(Ref("AWS::Region")),
        LaunchConfigurationName=Ref(r['webserver_lc']),
        LoadBalancerNames=[Ref(r['webserver_elb'])],

        UpdatePolicy=UpdatePolicy(
            AutoScalingRollingUpdate=AutoScalingRollingUpdate(
                PauseTime='PT5M',
                MinInstancesInService="1",
                MaxBatchSize='1',
                WaitOnResourceSignals=True
            )
        ),
        CreationPolicy=CreationPolicy(
            ResourceSignal=ResourceSignal(
                Timeout='PT15M'
            )
        ),
        HealthCheckGracePeriod=300,
        HealthCheckType="EC2",

        DesiredCapacity=If(
            "IsStaging",
            '1',
            '3',
        ),
        MinSize=If(
            "IsStaging",
            '1',
            '3'
        ),
        MaxSize=If(
            "IsStaging",
            '1',
            '5'
        )
    ))
```

This gives the error:

```
Traceback (most recent call last):
<-- snip -->
packages/troposphere/__init__.py", line 367, in default
    return obj.JSONrepr()
  File "venv/lib/python2.7/site-packages/troposphere/__init__.py", line 176, in JSONrepr
    self.validate()
  File "venv/lib/python2.7/site-packages/troposphere/autoscaling.py", line 147, in validate
    maxCount = int(self.MaxSize)
TypeError: int() argument must be a string or a number, not 'If'
```

Let me know if you need any other details.



Discussion:

Resolving patch:
diff --git a/troposphere/autoscaling.py b/troposphere/autoscaling.py
--- a/troposphere/autoscaling.py
+++ b/troposphere/autoscaling.py
@@ -3,7 +3,7 @@
 #
 # See LICENSE file for full license.
 
-from . import AWSHelperFn, AWSObject, AWSProperty, Ref, FindInMap
+from . import AWSHelperFn, AWSObject, AWSProperty, Ref, FindInMap, If
 from .validators import boolean, integer
 from . import cloudformation
 
@@ -141,7 +141,7 @@ def validate(self):
                     rolling_update.MinInstancesInService,
                     (FindInMap, Ref)
                 )
-                isMaxNoCheck = isinstance(self.MaxSize, (FindInMap, Ref))
+                isMaxNoCheck = isinstance(self.MaxSize, (FindInMap, Ref, If))
 
                 if not (isMinNoCheck or isMaxNoCheck):
                     maxCount = int(self.MaxSize)


Test patch:
Repository: cloudtools/troposphere

Issue:
Elasticsearch Domain DomainName shouldn't be required
According to the CF documentation, `DomainName` isn't required: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticsearch-domain.html



Discussion:

Resolving patch:
diff --git a/troposphere/elasticsearch.py b/troposphere/elasticsearch.py
--- a/troposphere/elasticsearch.py
+++ b/troposphere/elasticsearch.py
@@ -61,7 +61,7 @@ class ElasticsearchDomain(AWSObject):
     props = {
         'AccessPolicies': (policytypes, False),
         'AdvancedOptions': (dict, False),
-        'DomainName': (basestring, True),
+        'DomainName': (basestring, False),
         'EBSOptions': (EBSOptions, False),
         'ElasticsearchClusterConfig': (ElasticsearchClusterConfig, False),
         'SnapshotOptions': (SnapshotOptions, False),


Test patch:
Repository: cloudtools/troposphere

Issue:
AvailabilityZone/MultiAZ Validation broken for RDS
```
        avail_zone = self.properties.get('AvailabilityZone', None)
        multi_az = self.properties.get('MultiAZ', None)
        if not (isinstance(avail_zone, (AWSHelperFn, nonetype)) and
                isinstance(multi_az, (AWSHelperFn, nonetype))):
            if 'AvailabilityZone' in self.properties and \
                    self.properties.get('MultiAZ', None):
                raise ValueError("AvailabiltyZone cannot be set on "
                                 "DBInstance if MultiAZ is set to true.")
```

The issue here is that you should be able to set `AvailabilityZone` to something, and at the same time set `MultiAZ` to `False`, but with that code you couldn't currently.



Discussion:

Resolving patch:
diff --git a/troposphere/rds.py b/troposphere/rds.py
--- a/troposphere/rds.py
+++ b/troposphere/rds.py
@@ -199,8 +199,7 @@ def validate(self):
         multi_az = self.properties.get('MultiAZ', None)
         if not (isinstance(avail_zone, (AWSHelperFn, nonetype)) and
                 isinstance(multi_az, (AWSHelperFn, nonetype))):
-            if 'AvailabilityZone' in self.properties and \
-                    self.properties.get('MultiAZ', None):
+            if avail_zone and multi_az in [True, 1, '1', 'true', 'True']:
                 raise ValueError("AvailabiltyZone cannot be set on "
                                  "DBInstance if MultiAZ is set to true.")
 


Test patch:
diff --git a/tests/test_rds.py b/tests/test_rds.py
--- a/tests/test_rds.py
+++ b/tests/test_rds.py
@@ -2,6 +2,8 @@
 import troposphere.rds as rds
 from troposphere import If, Parameter, Ref
 
+AWS_NO_VALUE = "AWS::NoValue"
+
 
 class TestRDS(unittest.TestCase):
 
@@ -150,9 +152,16 @@ def test_fail_az_and_multiaz(self):
             MultiAZ=True)
         with self.assertRaisesRegexp(ValueError, "if MultiAZ is set to "):
             i.JSONrepr()
+        i.MultiAZ = "false"
+        i.JSONrepr()
+        i.MultiAZ = "true"
+        with self.assertRaisesRegexp(ValueError, "if MultiAZ is set to "):
+            i.JSONrepr()
+
+        i.MultiAZ = Ref(AWS_NO_VALUE)
+        i.JSONrepr()
 
     def test_az_and_multiaz_funcs(self):
-        AWS_NO_VALUE = "AWS::NoValue"
         db_az = "us-east-1"
         db_multi_az = Parameter("dbmultiaz", Type="String")
         i = rds.DBInstance(
Repository: cloudtools/troposphere

Issue:
S3ObjectVersion is spelled "SS3ObjectVersion" in the lambda Code object validation
I just noticed [this](https://github.com/cloudtools/troposphere/blob/1f67fb140f5b94cf0f29213a7300bad3ea046a0f/troposphere/awslambda.py#L31) while I was reading through the code. I haven't run into problems as I haven't had to use this particular key, but it looks like something you might want to know about.



Discussion:
Good eye (and my bad)!


Resolving patch:
diff --git a/troposphere/awslambda.py b/troposphere/awslambda.py
--- a/troposphere/awslambda.py
+++ b/troposphere/awslambda.py
@@ -28,7 +28,7 @@ def validate(self):
         zip_file = self.properties.get('ZipFile')
         s3_bucket = self.properties.get('S3Bucket')
         s3_key = self.properties.get('S3Key')
-        s3_object_version = self.properties.get('SS3ObjectVersion')
+        s3_object_version = self.properties.get('S3ObjectVersion')
 
         if zip_file and s3_bucket:
             raise ValueError("You can't specify both 'S3Bucket' and 'ZipFile'")


Test patch:
Repository: cloudtools/troposphere

Issue:
RDS template - "Engine" required even when "DBSnapshotIdentifier" is set
When creating an RDS instance using a Cloudformation template, the "Engine" property should not be required when "DBSnapshotIdentifier" is set, according to the Cloudformation documentation here:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-engine

However even when i have set "DBSnapshotIdentifier" i am getting the following error:
`ValueError: Resource Engine required in type AWS::RDS::DBInstance`
Which goes away when i set the "Engine" property.

Here is a minimal template demonstrating the issue:

```
#!/usr/bin/env python

from troposphere import Template
from troposphere.rds import DBInstance

template = Template()

rds_instance = template.add_resource(DBInstance(
    'MyDB',
    DBName='test',
    AllocatedStorage=25,
    DBInstanceClass='db.m4.large',
    DBSubnetGroupName='default',
    DBSnapshotIdentifier='id'
))

print template.to_json()
```

Thanks.



Discussion:

Resolving patch:
diff --git a/troposphere/rds.py b/troposphere/rds.py
--- a/troposphere/rds.py
+++ b/troposphere/rds.py
@@ -137,7 +137,7 @@ class DBInstance(AWSObject):
         'DBSecurityGroups': (list, False),
         'DBSnapshotIdentifier': (basestring, False),
         'DBSubnetGroupName': (basestring, False),
-        'Engine': (validate_engine, True),
+        'Engine': (validate_engine, False),
         'EngineVersion': (basestring, False),
         'Iops': (validate_iops, False),
         'KmsKeyId': (basestring, False),
@@ -187,6 +187,12 @@ def validate(self):
                 'AWS::RDS::DBInstance.'
             )
 
+        if 'DBSnapshotIdentifier' not in self.properties:
+            if 'Engine' not in self.properties:
+                raise ValueError(
+                    'Resource Engine is required in type %s'
+                    % self.resource_type)
+
         if 'KmsKeyId' in self.properties and \
            'StorageEncrypted' not in self.properties:
             raise ValueError(


Test patch:
Repository: cloudtools/troposphere

Issue:
Scaler AWSHelperFn should not override list context
The below test illustrates this issue. The param property is defined as a list of basestrings. This should then allow a list of AWSHelperFn as well (param=[Ref(fake)] below). However, a scaler AWSHelperFn should cause an error (param=Ref(fake) below) but is accepted. Correct behavior would be to raise a TypeError exception.
```
$ cat helper_test.py
import unittest

from troposphere import AWSObject, AWSProperty, Ref

class FakeRef(AWSObject):
    props = {
    }

class Prop(AWSProperty):
    props = {
        'param': ([basestring], True),
    }

class TestHelper(unittest.TestCase):
    def test_helper(self):
	fake = FakeRef('fakeref')
        Prop(param=["fakeref"])
        with self.assertRaises(TypeError):
            Prop(param="fakeref")
        Prop(param=[Ref(fake)])
        with self.assertRaises(TypeError):
            Prop(param=Ref(fake))

if __name__ == '__main__':
    unittest.main()

$ python helper_test.py
F
======================================================================
FAIL: test_helper (__main__.TestHelper)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "helper_test.py", line 22, in test_helper
    Prop(param=Ref(fake))
AssertionError: TypeError not raised

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (failures=1)
```


Discussion:

Resolving patch:
diff --git a/troposphere/__init__.py b/troposphere/__init__.py
--- a/troposphere/__init__.py
+++ b/troposphere/__init__.py
@@ -152,8 +152,11 @@ def __setattr__(self, name, value):
 
             # If the value is a AWSHelperFn we can't do much validation
             # we'll have to leave that to Amazon.  Maybe there's another way
-            # to deal with this that we'll come up with eventually
-            if isinstance(value, AWSHelperFn):
+            # to deal with this that we'll come up with eventually.
+            # We'll do validation below if there are AWSHelperFn in a
+            # list context.
+            if isinstance(value, AWSHelperFn) and \
+                    not isinstance(expected_type, list):
                 return self.properties.__setitem__(name, value)
 
             # If it's a function, call it...


Test patch:
diff --git a/tests/test_basic.py b/tests/test_basic.py
--- a/tests/test_basic.py
+++ b/tests/test_basic.py
@@ -379,5 +379,26 @@ def test_join(self):
             Join(10, "foobar")
 
 
+class TestHelperFn(unittest.TestCase):
+
+    def test_helperfn(self):
+        class FakeRef(AWSObject):
+            props = {
+            }
+
+        class Prop(AWSProperty):
+            props = {
+                'param': ([int], True),
+            }
+
+        fake = FakeRef('fakeref')
+        Prop(param=[1])
+        with self.assertRaises(TypeError):
+            Prop(param=1)
+        Prop(param=[Ref(fake)])
+        with self.assertRaises(TypeError):
+            Prop(param=Ref(fake))
+
+
 if __name__ == '__main__':
     unittest.main()
Repository: cloudtools/troposphere

Issue:
Add Tags to AWS::EC2::NatGateway
[AWS::EC2::NatGateway](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-natgateway.html)
Use the Tags property to specify resource tags for a NAT gateway.


Discussion:

Resolving patch:
diff --git a/troposphere/ec2.py b/troposphere/ec2.py
--- a/troposphere/ec2.py
+++ b/troposphere/ec2.py
@@ -102,6 +102,7 @@ class NatGateway(AWSObject):
     props = {
             'AllocationId': (basestring, True),
             'SubnetId': (basestring, True),
+            'Tags': (list, False),
     }
 
 


Test patch:
Repository: cloudtools/troposphere

Issue:
Add ResourceLifecycleConfig to AWS::ElasticBeanstalk::Application
[AWS::ElasticBeanstalk::Application](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk.html)
Use the ResourceLifecycleConfig property to define lifecycle settings for resources that belong to the application, and the service role that Elastic Beanstalk assumes in order to apply lifecycle settings.


Discussion:

Resolving patch:
diff --git a/troposphere/elasticbeanstalk.py b/troposphere/elasticbeanstalk.py
--- a/troposphere/elasticbeanstalk.py
+++ b/troposphere/elasticbeanstalk.py
@@ -4,7 +4,7 @@
 # See LICENSE file for full license.
 
 from . import AWSObject, AWSProperty, Tags
-
+from .validators import boolean, integer
 
 WebServer = "WebServer"
 Worker = "Worker"
@@ -12,6 +12,29 @@
 WorkerType = "SQS/HTTP"
 
 
+class MaxAgeRule(AWSProperty):
+    props = {
+      'DeleteSourceFromS3': (boolean, False),
+      'Enabled': (boolean, False),
+      'MaxAgeInDays': (integer, False),
+    }
+
+
+class MaxCountRule(AWSProperty):
+    props = {
+      'DeleteSourceFromS3': (boolean, False),
+      'Enabled': (boolean, False),
+      'MaxCount': (integer, False),
+    }
+
+
+class ApplicationVersionLifecycleConfig(AWSProperty):
+    props = {
+        'MaxAgeRule': (MaxAgeRule, False),
+        'MaxCountRule': (MaxCountRule, False),
+    }
+
+
 class SourceBundle(AWSProperty):
     props = {
         'S3Bucket': (basestring, True),
@@ -26,6 +49,13 @@ class SourceConfiguration(AWSProperty):
     }
 
 
+class ApplicationResourceLifecycleConfig(AWSProperty):
+    props = {
+        'ServiceRole': (basestring, False),
+        'VersionLifecycleConfig': (ApplicationVersionLifecycleConfig, False),
+    }
+
+
 class OptionSettings(AWSProperty):
     props = {
         'Namespace': (basestring, True),
@@ -40,6 +70,7 @@ class Application(AWSObject):
     props = {
         'ApplicationName': (basestring, False),
         'Description': (basestring, False),
+        'ResourceLifecycleConfig': (ApplicationResourceLifecycleConfig, False),
     }
 
 


Test patch:
Repository: cloudtools/troposphere

Issue:
Use the PlatformArn property to specify a custom platform for Elastic Beanstalk.
[AWS::ElasticBeanstalk::ConfigurationTemplate](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-beanstalk-configurationtemplate.html) and [AWS::ElasticBeanstalk::Environment](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-environment.html)
Use the PlatformArn property to specify a custom platform for Elastic Beanstalk.


Discussion:
Is it possible to get a bit more detail on this issue? I'd like to pick it up :)

I've used AWS a fair bit, but haven't really touched Elastic Beanstalk.

Resolving patch:
diff --git a/troposphere/elasticbeanstalk.py b/troposphere/elasticbeanstalk.py
--- a/troposphere/elasticbeanstalk.py
+++ b/troposphere/elasticbeanstalk.py
@@ -61,6 +61,7 @@ class ConfigurationTemplate(AWSObject):
         'Description': (basestring, False),
         'EnvironmentId': (basestring, False),
         'OptionSettings': ([OptionSettings], False),
+        'PlatformArn': (basestring, False),
         'SolutionStackName': (basestring, False),
         'SourceConfiguration': (SourceConfiguration, False),
     }
@@ -97,6 +98,7 @@ class Environment(AWSObject):
         'Description': (basestring, False),
         'EnvironmentName': (basestring, False),
         'OptionSettings': ([OptionSettings], False),
+        'PlatformArn': (basestring, False),
         'SolutionStackName': (basestring, False),
         'Tags': (Tags, False),
         'TemplateName': (basestring, False),


Test patch:
Repository: cloudtools/troposphere

Issue:
Add properties to AWS::Events::Rule Target property
[AWS::Events::Rule](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html)
In the Target property type, use the following properties for input transformation of events and setting Amazon ECS task and Kinesis stream targets.

- EcsParameters
- InputTransformer
- KinesisParameters
- RunCommandParameters


Discussion:

Resolving patch:
diff --git a/troposphere/events.py b/troposphere/events.py
--- a/troposphere/events.py
+++ b/troposphere/events.py
@@ -13,6 +13,32 @@ class EcsParameters(AWSProperty):
     }
 
 
+class InputTransformer(AWSProperty):
+    props = {
+        'InputPathsMap': (dict, False),
+        'InputTemplate': (basestring, True),
+    }
+
+
+class KinesisParameters(AWSProperty):
+    props = {
+        'PartitionKeyPath': (basestring, True),
+    }
+
+
+class RunCommandTarget(AWSProperty):
+    props = {
+        'Key': (basestring, True),
+        'Values': ([basestring], True),
+    }
+
+
+class RunCommandParameters(AWSProperty):
+    props = {
+        'RunCommandTargets': ([RunCommandTarget], True),
+    }
+
+
 class Target(AWSProperty):
     props = {
         'Arn': (basestring, True),
@@ -20,7 +46,10 @@ class Target(AWSProperty):
         'Id': (basestring, True),
         'Input': (basestring, False),
         'InputPath': (basestring, False),
+        'InputTransformer': (InputTransformer, False),
+        'KinesisParameters': (KinesisParameters, False),
         'RoleArn': (basestring, False),
+        'RunCommandParameters': (RunCommandParameters, False),
     }
 
 


Test patch:
Repository: cloudtools/troposphere

Issue:
Validation error in CodeCommit Trigger
It appears that the validation for the CodeCommit Trigger class does not currently allow the use of any intrinsic functions for the `Events` property, and only accepts a list of hard coded values.

https://github.com/cloudtools/troposphere/blob/45582eb1d21a6cc9cfa608f626d8acbf0317f37f/troposphere/codecommit.py#L18-L32

We are trying to allow for the dynamic selection of  the values with a  parameter, but encounter errors when attempting to use a `Ref`.  A snippet of our trigger definition, and the error encountered is below:

```
repo_trigger1 = codecommit.Trigger(
            Name = Ref(trigger_1_name),
            CustomData = Ref(trigger_1_custom_data),
            DestinationArn = Ref(trigger_1_destination_arn),
            Branches = Ref(trigger_1_branches),
            Events = Ref(trigger_1_events),
        )
```
We are able to successfully generate the template when changing the `Events` assignment to:

```Events = ["all"],```

I believe we just need to check if the value is one of the Helper functions before iterating through the events.  I will try to get a fix pushed up for review.


Discussion:

Resolving patch:
diff --git a/troposphere/codecommit.py b/troposphere/codecommit.py
--- a/troposphere/codecommit.py
+++ b/troposphere/codecommit.py
@@ -3,7 +3,7 @@
 #
 # See LICENSE file for full license.
 
-from . import AWSObject, AWSProperty
+from . import AWSHelperFn, AWSObject, AWSProperty
 
 
 class Trigger(AWSProperty):
@@ -23,12 +23,12 @@ def validate(self):
             'updateReference',
         ]
         events = self.properties.get('Events')
-        if events:
+        if events and not isinstance(events, AWSHelperFn):
             if 'all' in events and len(events) != 1:
                 raise ValueError('Trigger events: all must be used alone')
             else:
                 for e in events:
-                    if e not in valid:
+                    if e not in valid and not isinstance(e, AWSHelperFn):
                         raise ValueError('Trigger: invalid event %s' % e)
 
 


Test patch: