summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2010-01-22 13:29:19 -0500
committerScott Moser <smoser@ubuntu.com>2010-01-22 13:29:19 -0500
commit9645203e0c320a1623162124aa839f4163527d15 (patch)
treee8a47f16f28deecaf44ab1a945e76370e1466c92
parent1108a511010c4497e94bca78769bef30e3c01dff (diff)
downloadvyos-cloud-init-9645203e0c320a1623162124aa839f4163527d15.tar.gz
vyos-cloud-init-9645203e0c320a1623162124aa839f4163527d15.zip
only run setting of default locale and apt sources once-per-instance
-rwxr-xr-xec2-init.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/ec2-init.py b/ec2-init.py
index 4b4bd494..0ca01466 100755
--- a/ec2-init.py
+++ b/ec2-init.py
@@ -36,8 +36,8 @@ def main():
# set the defaults (like what ec2-set-defaults.py did)
try:
- generate_sources_list(cloud.get_mirror())
- apply_locale(cloud.get_locale())
+ cloud.sem_and_run("set_defaults", "once-per-instance",
+ set_defaults,cloud,False)
except:
warn("failed to set defaults\n")
@@ -61,6 +61,10 @@ def render_to_file(template, outfile, searchList):
f = open(outfile, 'w')
f.write(t.respond())
f.close()
+
+def set_defaults(cloud):
+ generate_sources_list(cloud.get_mirror())
+ apply_locale(cloud.get_locale())
def apply_locale(locale):
subprocess.Popen(['locale-gen', locale]).communicate()