parent
a51b499cb3
commit
a2b36e7299
11
main.py
11
main.py
|
@ -203,8 +203,7 @@ class CloudInitApp:
|
||||||
def _wrap_metadata(metadata):
|
def _wrap_metadata(metadata):
|
||||||
return {'ds': {
|
return {'ds': {
|
||||||
'meta_data': metadata
|
'meta_data': metadata
|
||||||
}
|
}}
|
||||||
}
|
|
||||||
|
|
||||||
def _user_data(self, uuid=None):
|
def _user_data(self, uuid=None):
|
||||||
"""
|
"""
|
||||||
|
@ -302,11 +301,11 @@ if __name__ == "__main__":
|
||||||
CONFIG["server"].getint("server_port", 8081)
|
CONFIG["server"].getint("server_port", 8081)
|
||||||
ENGINE = cherrypy.engine
|
ENGINE = cherrypy.engine
|
||||||
|
|
||||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
config = {
|
CONFIG = {
|
||||||
'/include': {
|
'/include': {
|
||||||
'tools.staticdir.on': True,
|
'tools.staticdir.on': True,
|
||||||
'tools.staticdir.dir': os.path.join(current_dir,
|
'tools.staticdir.dir': os.path.join(CURRENT_DIR,
|
||||||
'data',
|
'data',
|
||||||
'include'),
|
'include'),
|
||||||
'tools.staticdir.content_types': {
|
'tools.staticdir.content_types': {
|
||||||
|
@ -314,7 +313,7 @@ if __name__ == "__main__":
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cherrypy.tree.mount(ROOT, config=config)
|
cherrypy.tree.mount(ROOT, config=CONFIG)
|
||||||
|
|
||||||
if hasattr(ENGINE, "signal_handler"):
|
if hasattr(ENGINE, "signal_handler"):
|
||||||
ENGINE.signal_handler.subscribe()
|
ENGINE.signal_handler.subscribe()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user