]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
pybind/mgr/restful: move global variable into context.py
authorKefu Chai <kchai@redhat.com>
Fri, 9 Feb 2018 14:59:21 +0000 (22:59 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 11 Feb 2018 06:12:16 +0000 (14:12 +0800)
commit92af0732ea5cce5b9c62ca01e06fb6eac28987e7
tree6d48b75490ec31dc1ff919eff8a327f7eb31046b
parent5f892430462e29a69a9c8fb5875243c567cb4baf
pybind/mgr/restful: move global variable into context.py

otherwise we need to tackle with the circular import. it's not fatal, if
we can "import foo" in py2 and "from . import foo" in py3, respectively.
but we cannot unify them using "from . import foo", because the circular
reference issue. and conditionalize the import statement is ugly. so, i
think we'd better break the loop. so i am moving the "instance" variable
into its own file.

Signed-off-by: Kefu Chai <kchai@redhat.com>
12 files changed:
src/pybind/mgr/restful/api/config.py
src/pybind/mgr/restful/api/crush.py
src/pybind/mgr/restful/api/doc.py
src/pybind/mgr/restful/api/mon.py
src/pybind/mgr/restful/api/osd.py
src/pybind/mgr/restful/api/pool.py
src/pybind/mgr/restful/api/request.py
src/pybind/mgr/restful/api/server.py
src/pybind/mgr/restful/context.py [new file with mode: 0644]
src/pybind/mgr/restful/decorators.py
src/pybind/mgr/restful/hooks.py
src/pybind/mgr/restful/module.py