From a2b36e7299222141588c3e319f5bbad203f027a5 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Thu, 2 Dec 2021 15:50:34 +0800 Subject: [PATCH] PEP8 --- main.py | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/main.py b/main.py index f9e7663..2ad9741 100644 --- a/main.py +++ b/main.py @@ -134,7 +134,7 @@ class CloudInitRequest: filename = self._get_filename(META_DATA_FILENAME) if filename: self._update_meta_data_from_file( - filename + filename ) self.meta_data_loaded = True return self.meta_data @@ -202,9 +202,8 @@ class CloudInitApp: @staticmethod def _wrap_metadata(metadata): return {'ds': { - 'meta_data': metadata - } - } + 'meta_data': metadata + }} def _user_data(self, uuid=None): """ @@ -302,19 +301,19 @@ if __name__ == "__main__": CONFIG["server"].getint("server_port", 8081) ENGINE = cherrypy.engine - current_dir = os.path.dirname(os.path.abspath(__file__)) - config = { - '/include': { - 'tools.staticdir.on': True, - 'tools.staticdir.dir': os.path.join(current_dir, - 'data', - 'include'), - 'tools.staticdir.content_types': { - 'yml': 'text/yaml' - } - } - } - cherrypy.tree.mount(ROOT, config=config) + CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) + CONFIG = { + '/include': { + 'tools.staticdir.on': True, + 'tools.staticdir.dir': os.path.join(CURRENT_DIR, + 'data', + 'include'), + 'tools.staticdir.content_types': { + 'yml': 'text/yaml' + } + } + } + cherrypy.tree.mount(ROOT, config=CONFIG) if hasattr(ENGINE, "signal_handler"): ENGINE.signal_handler.subscribe()