]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: pool_percent_used should not divided by 100 20795/head
authorsongweibin <song.weibin@zte.com.cn>
Thu, 8 Mar 2018 02:29:22 +0000 (10:29 +0800)
committersongweibin <song.weibin@zte.com.cn>
Thu, 8 Mar 2018 02:29:22 +0000 (10:29 +0800)
The value of 'percent_used' in `ceph df --format=json`
has already been divided by 100.

Signed-off-by: songweibin <song.weibin@zte.com.cn>
src/tools/rbd/action/Trash.cc

index b1ad5ade30e78d9bd128589267b260c55ff5eaa0..ef0355ac5777203cd64ee562844f45a479556524 100644 (file)
@@ -421,7 +421,7 @@ int execute_purge (const po::variables_map &vm,
     for(uint8_t i = 0; i < arr.size(); ++i) {
       if(arr[i].get_obj()["name"] == pool_name) {
         json_spirit::mObject stats =  arr[i].get_obj()["stats"].get_obj();
-        pool_percent_used = stats["percent_used"].get_real() / 100;
+        pool_percent_used = stats["percent_used"].get_real();
         if(pool_percent_used <= threshold) {
           std::cout << "rbd: pool usage is lower than or equal to "
                     << (threshold*100)