summaryrefslogtreecommitdiff
path: root/ec2-init.py
diff options
context:
space:
mode:
authorScott Moser <smoser@nelson>2010-01-12 16:40:46 -0500
committerScott Moser <smoser@nelson>2010-01-12 16:40:46 -0500
commit56563878d00a6dc0c0853e97087ac86e5e8df666 (patch)
tree974964f26db26099b3dd9bb2c355c318cf03dad9 /ec2-init.py
parent1376ffe4de1e9cdcf5544ccecf50a18f46f7ed30 (diff)
downloadvyos-cloud-init-56563878d00a6dc0c0853e97087ac86e5e8df666.tar.gz
vyos-cloud-init-56563878d00a6dc0c0853e97087ac86e5e8df666.zip
add swap devices if there are any found
Diffstat (limited to 'ec2-init.py')
-rwxr-xr-xec2-init.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/ec2-init.py b/ec2-init.py
index 8d6c0932..b483fd5d 100755
--- a/ec2-init.py
+++ b/ec2-init.py
@@ -43,7 +43,21 @@ def main():
warn("failed to set defaults\n")
# set the ssh keys up
- cloud.apply_credentials()
+ try:
+ cloud.sem_and_run("apply_credentials", "once-per-instance",
+ cloud.apply_credentials,[],False)
+ except:
+ warn("applying credentials failed!\n")
+
+ # enable swap
+ try:
+ cloud.sem_and_run("enable_swap", "once-per-instance",
+ cloud.enable_swap,[],False)
+ except:
+ import traceback
+ traceback.print_exc(file=sys.stderr)
+ warn("enabling swap failed!\n")
+
# finish, send the cloud-config event
cloud.initctl_emit()