Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools/crushtool: skip device id if no name exists #18901

Merged
merged 1 commit into from
Nov 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/crush/CrushCompiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,12 @@ int CrushCompiler::decompile(ostream &out)

out << "\n# devices\n";
for (int i=0; i<crush.get_max_devices(); i++) {
out << "device " << i << " ";
print_item_name(out, i, crush);
print_item_class(out, i, crush);
out << "\n";
const char *name = crush.get_item_name(i);
if (name) {
out << "device " << i << " " << name;
print_item_class(out, i, crush);
out << "\n";
}
}

out << "\n# types\n";
Expand Down
1 change: 0 additions & 1 deletion src/test/cli/osdmaptool/create-racks.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
tunable allowed_bucket_algs 54

# devices
device 0 device0
device 1 osd.1
device 2 osd.2
device 3 osd.3
Expand Down