Skip to content

Commit 9cad67d

Browse files
committed
crowbar: Fix Node.get_network_by_type for overridden attributes
We were looking for attributes overriding the network proposal only on the node role, but this is not consistent with what the cookbook does (it looks at attributes on the node itself), and customer using this feature are more likely to edit the node directly. So reflect that by looking at the node attributes, which does include the attributes from the node role anyhow.
1 parent d2458a5 commit 9cad67d

File tree

1 file changed

+2
-2
lines changed
  • crowbar_framework/app/models

1 file changed

+2
-2
lines changed

crowbar_framework/app/models/node.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,11 +647,11 @@ def networks
647647

648648
def get_network_by_type(type)
649649
return nil if @role.nil?
650-
return nil unless crowbar["crowbar"]["network"].key?(type)
650+
return nil unless @node["crowbar"]["network"].key?(type)
651651
# note that node might not be part of network proposal yet (for instance:
652652
# if discovered, and IP got allocated by user)
653653
return nil if @node["network"]["networks"].nil? || !@node["network"]["networks"].key?(type)
654-
@node["network"]["networks"][type].to_hash.merge(crowbar["crowbar"]["network"][type].to_hash)
654+
@node["network"]["networks"][type].to_hash.merge(@node["crowbar"]["network"][type].to_hash)
655655
end
656656

657657
def set_network_attribute(network, attribute, value)

0 commit comments

Comments
 (0)