Skip to content

Commit ad1fbcc

Browse files
committed
Decrease the amount of node saves
Fix multiline comment Fix array initialization (was mistakenly initializing as a hash)
1 parent 6078a8a commit ad1fbcc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

chef/cookbooks/ceph/recipes/mon.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
add_key.error!
8989

9090
# no need to check if the attribute is already set: it's part of the
91+
# only_if
9192
node.set["ceph"]["monitor-secret"] = monitor_key
9293
node.save
9394
end

chef/cookbooks/ceph/recipes/osd.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
if is_crowbar?
7272
dirty = false
7373

74-
node.set["ceph"]["osd_devices"] ||= []
74+
node.set["ceph"]["osd_devices"] = [] if node["ceph"]["osd_devices"].nil?
7575
min_size_blocks = node["ceph"]["osd"]["min_size_gb"] * 1024 * 1024 * 2
7676
unclaimed_disks = BarclampLibrary::Barclamp::Inventory::Disk.unclaimed(node).sort.select { |d| d.size >= min_size_blocks }
7777

0 commit comments

Comments
 (0)