]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr: fix the TabError error
authorKefu Chai <kchai@redhat.com>
Thu, 8 Feb 2018 10:52:51 +0000 (18:52 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 11 Feb 2018 06:10:00 +0000 (14:10 +0800)
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
<module>
    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 <kchai@redhat.com>
src/pybind/mgr/dashboard/module.py
src/pybind/mgr/restful/api/pool.py

index 0a4026d113d2bc72d96072c6f68181fc6a3bd28e..67f079500db8c6ac5983043877e68928af209326 100644 (file)
@@ -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)
index a59e259cb625256961b829645fbe9dc965ddb52e..b9d2a8bae2007efdfde32ccf1680cb0a77d27df3 100644 (file)
@@ -34,7 +34,7 @@ class PoolId(RestController):
         """
         Modify the information for the pool id
         """
-       try:
+        try:
             args = request.json
         except ValueError:
             response.status = 400