Feature #1554: Make requirements and rank expressions able to search in /HOST/CLUSTER_TEMPLATE

This commit is contained in:
Carlos Martín committed 2013-01-22 15:07:57 +01:00
1 parent b676646656
commit 84c80c8d0f
2 files changed
+31

No files matched your search

+7
View File
@@ -105,11 +105,13 @@ expr: STRING { float val = 0.0;
ostringstream xpath_t;
ostringstream xpath_s;
ostringstream xpath_c;
vector<string> 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]);
+24
View File
@@ -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()];
}
}
}