From 91f83cc0a5e0b7a3ac672bc366a2879fc4a1fd8d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 8 Feb 2018 18:52:51 +0800 Subject: [PATCH] pybind/mgr: fix the TabError error 018-02-08 18:50:10.790 7fcfbb679700 -1 mgr[py] Module not found: 'dashboard' 2018-02-08 18:50:10.790 7fcfbb679700 -1 mgr[py] Traceback (most recent call last): File "/var/ceph/ceph/src/pybind/mgr/dashboard/__init__.py", line 2, in from . module import Module # NOQA File "/var/ceph/ceph/src/pybind/mgr/dashboard/module.py", line 1189 template = env.get_template("rgw_detail.html") ^ TabError: inconsistent use of tabs and spaces in indentation Fixes: http://tracker.ceph.com/issues/22880 Signed-off-by: Kefu Chai --- src/pybind/mgr/dashboard/module.py | 46 ++++++++++++++---------------- src/pybind/mgr/restful/api/pool.py | 2 +- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/pybind/mgr/dashboard/module.py b/src/pybind/mgr/dashboard/module.py index 0a4026d113d2b..67f079500db8c 100644 --- a/src/pybind/mgr/dashboard/module.py +++ b/src/pybind/mgr/dashboard/module.py @@ -1208,32 +1208,28 @@ class Module(MgrModule): @cherrypy.expose def index(self, rgw_id=None): if rgw_id is not None: - template = env.get_template("rgw_detail.html") - toplevel_data = self._toplevel_data() - return template.render( - url_prefix=global_instance().url_prefix, - ceph_version=global_instance().version, - path_info='/rgw' + cherrypy.request.path_info, - toplevel_data=json.dumps(toplevel_data, indent=2), - content_data=json.dumps(self.rgw_data(rgw_id), indent=2) - ) + template = env.get_template("rgw_detail.html") + toplevel_data = self._toplevel_data() + return template.render( + url_prefix=global_instance().url_prefix, + ceph_version=global_instance().version, + path_info='/rgw' + cherrypy.request.path_info, + toplevel_data=json.dumps(toplevel_data, indent=2), + content_data=json.dumps(self.rgw_data(rgw_id), indent=2) + ) else: + # List all RGW servers + template = env.get_template("rgw.html") + toplevel_data = self._toplevel_data() + content_data = self._rgw_daemons() + return template.render( + url_prefix = global_instance().url_prefix, + ceph_version=global_instance().version, + path_info='/rgw' + cherrypy.request.path_info, + toplevel_data=json.dumps(toplevel_data, indent=2), + content_data=json.dumps(content_data, indent=2) + ) - """ List all RGW servers """ - - template = env.get_template("rgw.html") - toplevel_data = self._toplevel_data() - - content_data = self._rgw_daemons() - - return template.render( - url_prefix = global_instance().url_prefix, - ceph_version=global_instance().version, - path_info='/rgw' + cherrypy.request.path_info, - toplevel_data=json.dumps(toplevel_data, indent=2), - content_data=json.dumps(content_data, indent=2) - ) - def _rgw_daemons(self): status, data = global_instance().rgw_daemons.get() if data is None: @@ -1268,7 +1264,7 @@ class Module(MgrModule): @cherrypy.expose @cherrypy.tools.json_out() def rgw_data(self, rgw_id): - return self._rgw(rgw_id) + return self._rgw(rgw_id) cherrypy.tree.mount(Root(), get_prefixed_url("/"), conf) cherrypy.tree.mount(OSDEndpoint(), get_prefixed_url("/osd"), conf) diff --git a/src/pybind/mgr/restful/api/pool.py b/src/pybind/mgr/restful/api/pool.py index a59e259cb6252..b9d2a8bae2007 100644 --- a/src/pybind/mgr/restful/api/pool.py +++ b/src/pybind/mgr/restful/api/pool.py @@ -34,7 +34,7 @@ class PoolId(RestController): """ Modify the information for the pool id """ - try: + try: args = request.json except ValueError: response.status = 400 -- 2.39.5