]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "mgr/pybind: expose erasure code profiles" 23339/head
authorNoah Watkins <noahwatkins@gmail.com>
Mon, 30 Jul 2018 22:11:05 +0000 (15:11 -0700)
committerNoah Watkins <noahwatkins@gmail.com>
Mon, 30 Jul 2018 22:20:34 +0000 (15:20 -0700)
The erasure code profiles are exposed through the OSD dump which was
overlooked on inspection.

This reverts commit b5487abb8b946c534d0e93f88c8b9b2d1cb35bae.

Signed-off-by: Noah Watkins <nwatkins@redhat.com>
src/mgr/ActivePyModules.cc
src/osd/OSDMap.cc
src/pybind/mgr/mgr_module.py
src/pybind/mgr/selftest/module.py

index 8ffa7fe2ea66155f0d4b362da6c9ee64bbda4256..6da3576bbb3a35282eb4ee3d5645c3b2449c750f 100644 (file)
@@ -362,13 +362,6 @@ PyObject *ActivePyModules::get_python(const std::string &what)
       mgr_map.dump(&f);
     });
     return f.get();
-  } else if (what == "ec_profiles") {
-    PyFormatter f;
-    cluster_state.with_osdmap([&f, &what](const OSDMap &osdmap){
-      const auto &profiles = osdmap.get_erasure_code_profiles();
-      osdmap.dump_erasure_code_profiles(profiles, &f);
-    });
-    return f.get();
   } else {
     derr << "Python module requested unknown data '" << what << "'" << dendl;
     Py_RETURN_NONE;
index f6f54a90536c529652f49c6517a028dfec5eb691..93550dc6e4da07f01f1a96c3c59e336f7ee78ed5 100644 (file)
@@ -1128,9 +1128,7 @@ void OSDMap::Incremental::dump(Formatter *f) const
   }
   f->close_section();
 
-  f->open_object_section("erasure_code_profiles");
   OSDMap::dump_erasure_code_profiles(new_erasure_code_profiles, f);
-  f->close_section();
   f->open_array_section("old_erasure_code_profiles");
   for (const auto &erasure_code_profile : old_erasure_code_profiles) {
     f->dump_string("old", erasure_code_profile.c_str());
@@ -3118,6 +3116,7 @@ void OSDMap::dump_erasure_code_profiles(
   const mempool::osdmap::map<string,map<string,string>>& profiles,
   Formatter *f)
 {
+  f->open_object_section("erasure_code_profiles");
   for (const auto &profile : profiles) {
     f->open_object_section(profile.first.c_str());
     for (const auto &profm : profile.second) {
@@ -3125,6 +3124,7 @@ void OSDMap::dump_erasure_code_profiles(
     }
     f->close_section();
   }
+  f->close_section();
 }
 
 void OSDMap::dump(Formatter *f) const
@@ -3256,9 +3256,7 @@ void OSDMap::dump(Formatter *f) const
   }
   f->close_section();
 
-  f->open_object_section("erasure_code_profiles");
   dump_erasure_code_profiles(erasure_code_profiles, f);
-  f->close_section();
 
   f->open_array_section("removed_snaps_queue");
   for (auto& p : removed_snaps_queue) {
index 93b828d8b665b2def163f03675db907c93ea2432..fd427bd074047eb5bc409e99073e2cb56b6f676c 100644 (file)
@@ -353,7 +353,7 @@ class MgrModule(ceph_module.BaseMgrModule):
         :param str data_name: Valid things to fetch are osd_crush_map_text, 
                 osd_map, osd_map_tree, osd_map_crush, config, mon_map, fs_map,
                 osd_metadata, pg_summary, io_rate, pg_dump, df, osd_stats,
-                health, mon_status, devices, device <devid>, ec_profiles.
+                health, mon_status, devices, device <devid>.
 
         Note:
             All these structures have their own JSON representations: experiment
index 1b519a368d9d82d77ddaf36b7a5d616bcf75884a..5917ee2dc11c35310425799467191e621abafeaf 100644 (file)
@@ -151,8 +151,7 @@ class Module(MgrModule):
                 "osd_stats",
                 "health",
                 "mon_status",
-                "mgr_map",
-                "ec_profiles"
+                "mgr_map"
                 ]
         for obj in objects:
             assert self.get(obj) is not None