File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -746,20 +746,25 @@ int main(int argc, char **argv)
746746 else if (action == " show-label" ) {
747747 JSONFormatter jf (true );
748748 jf.open_object_section (" devices" );
749+ bool any_success = false ;
749750 for (auto & i : devs) {
751+ jf.open_object_section (i.c_str ());
750752 bluestore_bdev_label_t label;
751753 int r = BlueStore::read_bdev_label (cct.get (), i, &label);
752754 if (r < 0 ) {
753- cerr << " unable to read label for " << i << " : "
754- << cpp_strerror (r) << std::endl;
755- exit (EXIT_FAILURE);
755+ cerr << " unable to read label for " << i << " : "
756+ << cpp_strerror (r) << std::endl;
757+ } else {
758+ any_success = true ;
759+ label.dump (&jf);
756760 }
757- jf.open_object_section (i.c_str ());
758- label.dump (&jf);
759761 jf.close_section ();
760762 }
761763 jf.close_section ();
762764 jf.flush (cout);
765+ if (!any_success) {
766+ exit (EXIT_FAILURE);
767+ }
763768 }
764769 else if (action == " set-label-key" ) {
765770 bluestore_bdev_label_t label;
You can’t perform that action at this time.
0 commit comments