FWIW, looking at this again, disk_enum_expr should return all unclaimed disks, while disk_test_expr should more or less be claiming the disk. This matches better what the recipe is expecting, and would likely be a bit safer if user change this.

Something like this:

"disk_enum_expr": "r = Hash.new; BarclampLibrary::Barclamp::Inventory::Disk.unclaimed(node).each do |d| r[d.device] = d end; r"
"disk_test_expr": "v.claim(\"Swift\")"

Any objection against this approach instead?