diff --git a/src/xml/expr_arith.y b/src/xml/expr_arith.y index b5eb4c0be5..ebd59a4fd5 100644 --- a/src/xml/expr_arith.y +++ b/src/xml/expr_arith.y @@ -105,11 +105,13 @@ expr: STRING { float val = 0.0; ostringstream xpath_t; ostringstream xpath_s; + ostringstream xpath_c; vector results; xpath_t << "/HOST/TEMPLATE/" << $1; xpath_s << "/HOST/HOST_SHARE/" << $1; + xpath_c << "/HOST/CLUSTER_TEMPLATE/" << $1; results = (*oxml)[xpath_t.str().c_str()]; @@ -118,6 +120,11 @@ expr: STRING { float val = 0.0; results = (*oxml)[xpath_s.str().c_str()]; } + if (results.size() == 0) + { + results = (*oxml)[xpath_c.str().c_str()]; + } + if (results.size() != 0) { istringstream iss(results[0]); diff --git a/src/xml/expr_bool.y b/src/xml/expr_bool.y index 504948b757..46133eea65 100644 --- a/src/xml/expr_bool.y +++ b/src/xml/expr_bool.y @@ -214,6 +214,14 @@ void get_xml_attribute(ObjectXML * oxml, const char* attr, int& val) xpath_h << "/HOST/" << attr; results = (*oxml)[xpath_h.str().c_str()]; + + if (results.size() == 0) + { + xpath_h.str(""); + + xpath_h << "/HOST/CLUSTER_TEMPLATE/" << attr; + results = (*oxml)[xpath_h.str().c_str()]; + } } } @@ -248,6 +256,14 @@ void get_xml_attribute(ObjectXML * oxml, const char* attr, float& val) xpath_h << "/HOST/" << attr; results = (*oxml)[xpath_h.str().c_str()]; + + if (results.size() == 0) + { + xpath_h.str(""); + + xpath_h << "/HOST/CLUSTER_TEMPLATE/" << attr; + results = (*oxml)[xpath_h.str().c_str()]; + } } } @@ -282,6 +298,14 @@ void get_xml_attribute(ObjectXML * oxml, const char* attr, string& val) xpath_h << "/HOST/" << attr; results = (*oxml)[xpath_h.str().c_str()]; + + if (results.size() == 0) + { + xpath_h.str(""); + + xpath_h << "/HOST/CLUSTER_TEMPLATE/" << attr; + results = (*oxml)[xpath_h.str().c_str()]; + } } }