From 93946ba627b105b5b0a973123b345faafd7822e6 Mon Sep 17 00:00:00 2001
From: Ryan Brown <sb@ryansb.com>
Date: Tue, 13 Mar 2018 16:02:39 -0400
Subject: [PATCH] Use NormalizedOperationMethod to catch ClientErrors so the
 waiter can handle them properly (#37356)

---
 lib/ansible/module_utils/aws/waiters.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/ansible/module_utils/aws/waiters.py b/lib/ansible/module_utils/aws/waiters.py
index c8f9157dbc2..4f772fc47f8 100644
--- a/lib/ansible/module_utils/aws/waiters.py
+++ b/lib/ansible/module_utils/aws/waiters.py
@@ -24,7 +24,7 @@ ec2_data = {
                     "matcher": "error",
                     "expected": "InvalidRouteTableID.NotFound",
                     "state": "retry"
-                }
+                },
             ]
         }
     }
@@ -40,7 +40,9 @@ waiters_by_name = {
     ('EC2', 'route_table_exists'): lambda ec2: core_waiter.Waiter(
         'route_table_exists',
         model_for('RouteTableExists'),
-        ec2.describe_route_tables)
+        core_waiter.NormalizedOperationMethod(
+            ec2.describe_route_tables
+        ))
 }