While using the invoke_lambda action on StackStorm 3.1.0 on Python 3.6.9 I encounter a bug with the following lines:
|
if 'account_id' in kwargs: |
|
self.assume_role(kwargs.pop('account_id')) |
|
if 'region' in kwargs: |
|
self.credentials['region'] = kwargs.pop('region') |
Debugging has shown that actions which do not specify an account_id or a region are still receiving them in the kwargs dict, but with a None value.
I would recommend this change:
account_id = kwargs.pop('account_id', None)
if account_id:
self.assume_role(account_id)
region = kwargs.pop('region', None)
if region:
self.credentials['region'] = region