Commit af9ed869 authored by Srikanth Raju's avatar Srikanth Raju Committed by Leigh B Stoller
Browse files

Use IP of boss in meta server

Ignore Metadata version
parent 39ed8ed6
...@@ -28,8 +28,9 @@ class Ec2MetaHandler(BaseHTTPRequestHandler): ...@@ -28,8 +28,9 @@ class Ec2MetaHandler(BaseHTTPRequestHandler):
if only_path=="/": if only_path=="/":
break; break;
if len(folders) > 0:
folders.pop() #Ignore version
folders.reverse() folders.reverse()
print folders
try: try:
message = self.handle_req(folders, self.metas) message = self.handle_req(folders, self.metas)
...@@ -178,7 +179,6 @@ class Ec2MetaHandler(BaseHTTPRequestHandler): ...@@ -178,7 +179,6 @@ class Ec2MetaHandler(BaseHTTPRequestHandler):
return key[0] return key[0]
metas = { metas = {
"latest" : {
"meta-data" : { "meta-data" : {
"placement" : {"availability-zone" : doavail}, "placement" : {"availability-zone" : doavail},
"ami-id": doamiid, "ami-id": doamiid,
...@@ -190,12 +190,13 @@ class Ec2MetaHandler(BaseHTTPRequestHandler): ...@@ -190,12 +190,13 @@ class Ec2MetaHandler(BaseHTTPRequestHandler):
"public-keys": dopublic_keys }, "public-keys": dopublic_keys },
"user-data" : do_userdata "user-data" : do_userdata
} }
}
if __name__ == '__main__': if __name__ == '__main__':
from BaseHTTPServer import HTTPServer from BaseHTTPServer import HTTPServer
server = HTTPServer(('155.98.36.155', 8787), Ec2MetaHandler) import socket
server = HTTPServer((socket.gethostbyname(socket.gethostname()), 8787), Ec2MetaHandler)
print 'Starting server, use <Ctrl-C> to stop' print 'Starting server, use <Ctrl-C> to stop'
server.serve_forever() server.serve_forever()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment