Commit ca0bac29 authored by Brecht Vermeulen's avatar Brecht Vermeulen

Fix regexps in 'Attempt to parse the violations into something human readable'

e.G. the following assign violations gave just 'Not enough bandwdith' as the 0 always matched.
Now we match with any number 1-9

   BEST SCORE:  50.5 in 0 iters and 0.008631 seconds
  unassigned:  0
  pnode_load:  26
  no_connect:  0
  link_users:  0
  bandwidth:   0
  desires:     0
  vclass:      0
  delay:       0
  trivial mix: 0
  subnodes:    0
  max_types:   0
  endpoints:   0
parent c2f70a6c
......@@ -2318,16 +2318,16 @@ sub GetTicketAuxAux($$$$$$$$$$)
$violations .= $line;
# Attempt to parse the violations into something human readable.
if ($line =~ /no_connect:\s*\d*/ ||
$line =~ /bandwidth:\s*\d*/) {
if ($line =~ /no_connect:\s*[1-9]/ ||
$line =~ /bandwidth:\s*[1-9]/) {
$errorstr = "Not enough bandwidth to connect some nodes";
$errorcode = GENIRESPONSE_INSUFFICIENT_BANDWIDTH();
}
elsif ($line =~ /pnode_load:\s*1/) {
elsif ($line =~ /pnode_load:\s*[1-9]/) {
$errorstr = "Too many VMs requested on physical host";
$errorcode = GENIRESPONSE_INSUFFICIENT_NODES();
}
elsif ($line =~ /unassigned:\s*1/) {
elsif ($line =~ /unassigned:\s*[1-9]/) {
$errorstr = "Not enough nodes with fast enough interfaces";
$errorcode = GENIRESPONSE_INSUFFICIENT_NODES();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment