From 9101b5893469316255e86594664e3414d405d9fa Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Sun, 6 Nov 2016 10:57:01 -0500 Subject: [PATCH] Need to speficy how we are sorting. --- moto/iam/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moto/iam/models.py b/moto/iam/models.py index 14fba2ae7..a524c81f8 100644 --- a/moto/iam/models.py +++ b/moto/iam/models.py @@ -418,7 +418,7 @@ class IAMBackend(BaseBackend): if path_prefix: policies = [p for p in policies if p.path.startswith(path_prefix)] - policies = sorted(policies) + policies = sorted(policies, key=lambda policy: policy.name) start_idx = int(marker) if marker else 0 policies = policies[start_idx:start_idx + max_items] @@ -444,7 +444,7 @@ class IAMBackend(BaseBackend): if path_prefix: policies = [p for p in policies if p.path.startswith(path_prefix)] - policies = sorted(policies) + policies = sorted(policies, key=lambda policy: policy.name) start_idx = int(marker) if marker else 0 policies = policies[start_idx:start_idx + max_items]