From 5027416fb5053d15722c09066af4b0716332ae6c Mon Sep 17 00:00:00 2001 From: patocl Date: Tue, 20 Aug 2019 08:25:57 +0200 Subject: [PATCH] Sort version list on azure_rm_aksversion_facts (#60820) --- .../modules/cloud/azure/azure_rm_aksversion_facts.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/azure/azure_rm_aksversion_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_aksversion_facts.py index 6ff6a258da7..97d8cb2e60f 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_aksversion_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_aksversion_facts.py @@ -101,7 +101,7 @@ class AzureRMAKSVersion(AzureRMModuleBase): def get_all_versions(self, location, version): ''' Get all kubernetes version supported by AKS - :return: version list + :return: ordered version list ''' try: result = dict() @@ -112,7 +112,9 @@ class AzureRMAKSVersion(AzureRMModuleBase): if version: return result.get(version) or [] else: - return result.keys() + keys = list(result.keys()) + keys.sort() + return keys except Exception as exc: self.fail('Error when getting AKS supported kubernetes version list for location {0} - {1}'.format(self.location, exc.message or str(exc)))