Simulator is broken after Python code refactoring
The issue was found by @wlodek during 1.12 sanity checks.
While running demo I am getting this error:
stork-1120-simulator-1 | * Serving Flask app 'sim.py' (lazy loading)
stork-1120-simulator-1 | * Environment: development
stork-1120-simulator-1 | * Debug mode: on
stork-1120-simulator-1 | Traceback (most recent call last):
stork-1120-simulator-1 | File "/usr/local/bin/flask", line 11, in <module>
stork-1120-simulator-1 | sys.exit(main())
stork-1120-simulator-1 | File "/usr/local/lib/python3.6/dist-packages/flask/cli.py", line 995, in main
stork-1120-simulator-1 | cli.main(args=sys.argv[1:])
stork-1120-simulator-1 | File "/usr/local/lib/python3.6/dist-packages/flask/cli.py", line 601, in main
stork-1120-simulator-1 | return super().main(*args, **kwargs)
stork-1120-simulator-1 | File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1053, in main
stork-1120-simulator-1 | rv = self.invoke(ctx)
stork-1120-simulator-1 | File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1659, in invoke
stork-1120-simulator-1 | return _process_result(sub_ctx.command.invoke(sub_ctx))
stork-1120-simulator-1 | File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1395, in invoke
stork-1120-simulator-1 | return ctx.invoke(self.callback, **ctx.params)
stork-1120-simulator-1 | File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 754, in invoke
stork-1120-simulator-1 | return __callback(*args, **kwargs)
stork-1120-simulator-1 | File "/usr/local/lib/python3.6/dist-packages/click/decorators.py", line 84, in new_func
stork-1120-simulator-1 | return ctx.invoke(f, obj, *args, **kwargs)
stork-1120-simulator-1 | File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 754, in invoke
stork-1120-simulator-1 | return __callback(*args, **kwargs)
stork-1120-simulator-1 | File "/usr/local/lib/python3.6/dist-packages/flask/cli.py", line 850, in run_command
stork-1120-simulator-1 | app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
stork-1120-simulator-1 | File "/usr/local/lib/python3.6/dist-packages/flask/cli.py", line 325, in __init__
stork-1120-simulator-1 | self._load_unlocked()
stork-1120-simulator-1 | File "/usr/local/lib/python3.6/dist-packages/flask/cli.py", line 351, in _load_unlocked
stork-1120-simulator-1 | self._app = rv = self.loader()
stork-1120-simulator-1 | File "/usr/local/lib/python3.6/dist-packages/flask/cli.py", line 407, in load_app
stork-1120-simulator-1 | app = locate_app(self, import_name, name)
stork-1120-simulator-1 | File "/usr/local/lib/python3.6/dist-packages/flask/cli.py", line 260, in locate_app
stork-1120-simulator-1 | __import__(module_name)
stork-1120-simulator-1 | File "/sim/sim.py", line 214, in <module>
stork-1120-simulator-1 | app, log = init()
stork-1120-simulator-1 | File "/sim/sim.py", line 204, in init
stork-1120-simulator-1 | log_instance = create_logger(app)
stork-1120-simulator-1 | File "/usr/local/lib/python3.6/dist-packages/flask/logging.py", line 66, in create_logger
stork-1120-simulator-1 | logger = logging.getLogger(app.name)
stork-1120-simulator-1 | AttributeError: 'NoneType' object has no attribute 'name'