Mentions légales du service

Skip to content
Snippets Groups Projects

Fix wrong cluster configuration used when multiple match

Merged Alexandre MERLIN requested to merge fix-wrong-cluster-conf into master
1 file
+ 2
1
Compare changes
  • Side-by-side
  • Inline
@@ -224,13 +224,14 @@ class Lanpower::Application::Lanpower < Lanpower::Application
def getnode(arg)
shortname = arg.split('.')[0]
clustername = shortname.split('-')[0]
# Node-specific configuration
nodename = @nodes_keys.select { |n| shortname == n }.first
if !nodename.nil?
node = @conf.value["nodes"][nodename]
else
# Cluster-wide configuration
cluster = @clusters.select { |c| !arg.match(c).nil? }.first
cluster = @clusters.select { |c| clustername == c }.first
if !cluster.nil?
node = @conf.value["clusters"][cluster]
else
Loading