summaryrefslogtreecommitdiff
path: root/ec2-fetch-credentials.py
diff options
context:
space:
mode:
Diffstat (limited to 'ec2-fetch-credentials.py')
-rwxr-xr-xec2-fetch-credentials.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/ec2-fetch-credentials.py b/ec2-fetch-credentials.py
index 52176003..68922878 100755
--- a/ec2-fetch-credentials.py
+++ b/ec2-fetch-credentials.py
@@ -20,6 +20,8 @@
#
import urllib
import os
+import socket
+import sys
from configobj import ConfigObj
api_ver = '2008-02-01'
@@ -60,6 +62,16 @@ def setup_root_user(k,root_config):
else:
print "%s - I dont understand that opion."
+def checkServer():
+ s = socket.socket()
+ try:
+ address = '169.254.169.254'
+ port = 80
+ s.connect((address,port))
+ except socket.error, e:
+ print "!!! Unable to connect to %s" % address
+ sys.exit(0)
+
os.umask(077)
if user == "":
print "User must exist in %s" %(filename)