diff --git a/changelogs/fragments/1477-elbv2-botocore.yml b/changelogs/fragments/1477-elbv2-botocore.yml new file mode 100644 index 00000000000..54736b033a3 --- /dev/null +++ b/changelogs/fragments/1477-elbv2-botocore.yml @@ -0,0 +1,2 @@ +minor_changes: +- module_utils/elbv2 - removed compatibility code for ``botocore < 1.10.30`` (https://github.com/ansible-collections/amazon.aws/pull/1477). diff --git a/plugins/module_utils/elbv2.py b/plugins/module_utils/elbv2.py index f63dc3f3653..04f6114e15a 100644 --- a/plugins/module_utils/elbv2.py +++ b/plugins/module_utils/elbv2.py @@ -788,15 +788,6 @@ def _compare_listener(self, current_listener, new_listener): # Default action - # Check proper rule format on current listener - if len(current_listener['DefaultActions']) > 1: - for action in current_listener['DefaultActions']: - if 'Order' not in action: - self.module.fail_json(msg="'Order' key not found in actions. " - "installed version of botocore does not support " - "multiple actions, please upgrade botocore to version " - "1.10.30 or higher") - # If the lengths of the actions are the same, we'll have to verify that the # contents of those actions are the same if len(current_listener['DefaultActions']) == len(new_listener['DefaultActions']): @@ -841,12 +832,7 @@ def add(self): self.listener.pop('Rules') AWSRetry.jittered_backoff()(self.connection.create_listener)(LoadBalancerArn=self.elb_arn, **self.listener) except (BotoCoreError, ClientError) as e: - if '"Order", must be one of: Type, TargetGroupArn' in str(e): - self.module.fail_json(msg="installed version of botocore does not support " - "multiple actions, please upgrade botocore to version " - "1.10.30 or higher") - else: - self.module.fail_json_aws(e) + self.module.fail_json_aws(e) def modify(self): @@ -856,12 +842,7 @@ def modify(self): self.listener.pop('Rules') AWSRetry.jittered_backoff()(self.connection.modify_listener)(**self.listener) except (BotoCoreError, ClientError) as e: - if '"Order", must be one of: Type, TargetGroupArn' in str(e): - self.module.fail_json(msg="installed version of botocore does not support " - "multiple actions, please upgrade botocore to version " - "1.10.30 or higher") - else: - self.module.fail_json_aws(e) + self.module.fail_json_aws(e) def delete(self): @@ -994,15 +975,6 @@ def _compare_rule(self, current_rule, new_rule): # Actions - # Check proper rule format on current listener - if len(current_rule['Actions']) > 1: - for action in current_rule['Actions']: - if 'Order' not in action: - self.module.fail_json(msg="'Order' key not found in actions. " - "installed version of botocore does not support " - "multiple actions, please upgrade botocore to version " - "1.10.30 or higher") - # If the lengths of the actions are the same, we'll have to verify that the # contents of those actions are the same if len(current_rule['Actions']) == len(new_rule['Actions']): @@ -1086,12 +1058,7 @@ def create(self): self.rule['Priority'] = int(self.rule['Priority']) AWSRetry.jittered_backoff()(self.connection.create_rule)(**self.rule) except (BotoCoreError, ClientError) as e: - if '"Order", must be one of: Type, TargetGroupArn' in str(e): - self.module.fail_json(msg="installed version of botocore does not support " - "multiple actions, please upgrade botocore to version " - "1.10.30 or higher") - else: - self.module.fail_json_aws(e) + self.module.fail_json_aws(e) self.changed = True @@ -1106,12 +1073,7 @@ def modify(self): del self.rule['Priority'] AWSRetry.jittered_backoff()(self.connection.modify_rule)(**self.rule) except (BotoCoreError, ClientError) as e: - if '"Order", must be one of: Type, TargetGroupArn' in str(e): - self.module.fail_json(msg="installed version of botocore does not support " - "multiple actions, please upgrade botocore to version " - "1.10.30 or higher") - else: - self.module.fail_json_aws(e) + self.module.fail_json_aws(e) self.changed = True