summaryrefslogtreecommitdiff
path: root/ec2-set-defaults.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2009-12-14 16:17:41 -0500
committerScott Moser <smoser@ubuntu.com>2009-12-14 16:17:41 -0500
commit7bc6bbe8c4475151ee196ced344d1f045486bc1f (patch)
tree46e93df233833c5b59700420ae495f7b738e8299 /ec2-set-defaults.py
parent2e5e426e406c4b72942020460993e5fb91dcb9b6 (diff)
downloadvyos-cloud-init-7bc6bbe8c4475151ee196ced344d1f045486bc1f.tar.gz
vyos-cloud-init-7bc6bbe8c4475151ee196ced344d1f045486bc1f.zip
sync karmic and trunk
This commit merges lp:~soren/ec2-init/0.5 at rev 67 and lp:ubuntu/lucid at 0.4.999-0ubuntu8
Diffstat (limited to 'ec2-set-defaults.py')
-rwxr-xr-xec2-set-defaults.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/ec2-set-defaults.py b/ec2-set-defaults.py
index 4191538e..364225aa 100755
--- a/ec2-set-defaults.py
+++ b/ec2-set-defaults.py
@@ -28,10 +28,16 @@ def main():
ec2 = ec2init.EC2Init()
availability_zone = ec2.get_availability_zone()
- location = ec2.get_location_from_availability_zone(availability_zone)
- mirror = ec2.get_mirror_from_availability_zone(availability_zone)
- locale = ec2.location_locale_map[location]
+ try:
+ location = ec2.get_location_from_availability_zone(availability_zone)
+ locale = ec2.location_locale_map[location]
+ except Exception, e:
+ locale = "en_US.UTF-8"
+
+ # get_mirror_from_availability_zone returns default on no match
+ mirror = ec2.get_mirror_from_availability_zone(availability_zone)
+
apply_locale(locale)
generate_sources_list(mirror)