Sort version list on azure_rm_aksversion_facts (#60820)

This commit is contained in:
patocl 2019-08-20 08:25:57 +02:00 committed by Yunge Zhu
parent dae2040717
commit 5027416fb5

View file

@ -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)))