Repository: aws-cloudformation/cfn-lint

Issue:
Update rule E2541 to not error when action names are not strings
*Issue #, if available:*
Fix #752
*Description of changes:*
- Update rule E2541 to only check for duplicate names when the action name is a string

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.



Discussion:
# [Codecov](https://codecov.io/gh/aws-cloudformation/cfn-python-lint/pull/756?src=pr&el=h1) Report
> Merging [#756](https://codecov.io/gh/aws-cloudformation/cfn-python-lint/pull/756?src=pr&el=desc) into [master](https://codecov.io/gh/aws-cloudformation/cfn-python-lint/commit/19ed6d52fd1c08d9a5517f9c4f0bff64e959f171?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/aws-cloudformation/cfn-python-lint/pull/756/graphs/tree.svg?width=650&token=MtiYFwfmh9&height=150&src=pr)](https://codecov.io/gh/aws-cloudformation/cfn-python-lint/pull/756?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #756      +/-   ##
==========================================
- Coverage   85.47%   85.46%   -0.01%     
==========================================
  Files         121      121              
  Lines        7062     7065       +3     
  Branches     1694     1695       +1     
==========================================
+ Hits         6036     6038       +2     
- Misses        641      642       +1     
  Partials      385      385
```


| [Impacted Files](https://codecov.io/gh/aws-cloudformation/cfn-python-lint/pull/756?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...resources/codepipeline/CodepipelineStageActions.py](https://codecov.io/gh/aws-cloudformation/cfn-python-lint/pull/756/diff?src=pr&el=tree#diff-c3JjL2NmbmxpbnQvcnVsZXMvcmVzb3VyY2VzL2NvZGVwaXBlbGluZS9Db2RlcGlwZWxpbmVTdGFnZUFjdGlvbnMucHk=) | `83.75% <100%> (-0.67%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/aws-cloudformation/cfn-python-lint/pull/756?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/aws-cloudformation/cfn-python-lint/pull/756?src=pr&el=footer). Last update [19ed6d5...3a2b083](https://codecov.io/gh/aws-cloudformation/cfn-python-lint/pull/756?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Resolving patch:
diff --git a/src/cfnlint/transform.py b/src/cfnlint/transform.py
--- a/src/cfnlint/transform.py
+++ b/src/cfnlint/transform.py
@@ -78,8 +78,10 @@ def _replace_local_codeuri(self):
                     resource_dict['Location'] = ''
                     Transform._update_to_s3_uri('Location', resource_dict)
             if resource_type == 'AWS::Serverless::Api':
-                if 'DefinitionBody' not in resource_dict:
+                if 'DefinitionBody' not in resource_dict and 'Auth' not in resource_dict:
                     Transform._update_to_s3_uri('DefinitionUri', resource_dict)
+                else:
+                    resource_dict['DefinitionBody'] = ''
 
     def transform_template(self):
         """


Test patch: