From c2e380381050ff7ddefc2d6a13208d090996331e Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 5 Aug 2015 11:57:06 -0600 Subject: [PATCH] Make sure the key we're comparing is also lowercase Fixes #25616 --- salt/cloud/clouds/linode.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/salt/cloud/clouds/linode.py b/salt/cloud/clouds/linode.py index 0b5025f9dc..5b2f3deffa 100644 --- a/salt/cloud/clouds/linode.py +++ b/salt/cloud/clouds/linode.py @@ -515,17 +515,16 @@ if HAS_LINODEPY: # No, let's try to match it against the full # name and the abbreviation and return the id for key in locations: - if str(loc).lower() in (key, + if str(loc).lower() in (str(key).lower(), str(locations[key]['id']).lower(), - str(locations[key]['abbreviation']). - lower()): + str(locations[key]['abbreviation']).lower()): return locations[key]['id'] else: return loc - # No match. Return None, cloud provider will - # use a default or throw an exception - return None + # No match. Return default Linode data center location, which is Dallas + # Dallas is represented by '2' in the Linode API. + return 2 def get_disk_size(vm_, size, swap): '''