lib/brocade/vtmquirksmanager.rb
# Insert the node priority and weight values if they are missing.
Insert the node priority and weight values if they are missing.
Insert the node priority and weight values if they are missing .
def nodePriorities(json)
			hash = JSON.parse(json)
			modified = false
			hash["properties"]["basic"]["nodes_table"].each do |node|
				if (! node.include?("priority"))
					node["priority"] = 1
					modified = true
				end
				if (! node.include?("weight"))
					node["weight"] = 1
					modified = true
				end
			end
			if modified
				return JSON.generate(hash)
			else
				return json
			end
		end
def nodePriorities ( json ) hash = JSON . parse ( json ) modified = false hash [ "properties" ] [ "basic" ] [ "nodes_table" ] . each do | node | if ( ! node . include? ( "priority" ) ) node [ "priority" ] = 1 modified = true end if ( ! node . include? ( "weight" ) ) node [ "weight" ] = 1 modified = true end end if modified return JSON . generate ( hash ) else return json end end
Insert the node priority and weight values if they are missing.
Insert the node priority and weight values if they are missing .
json
<not_specific>