1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-04-02 10:50:07 +03:00

Feature #4238: Enable multi option defaults

This commit is contained in:
Jaime Melis 2015-12-21 17:02:05 +01:00
parent 242dae3d92
commit 3c11db6872
2 changed files with 16 additions and 6 deletions

View File

@ -187,6 +187,12 @@ private:
*/
void set_multiple_conf_default();
/**
* register the multiple configuration attributes and clean the
* conf_default hash
*/
void register_multiple_conf_default(const std::string& conf_section);
/**
* Sets a default single attribute value
*/

View File

@ -114,10 +114,16 @@ void OpenNebulaTemplate::set_multiple_conf_default()
set_conf_tm("ceph", "NONE", "SELF", "yes", "no");
set_conf_tm("dev", "NONE", "NONE", "yes", "no");
// *************************************************************************
// Defaults
// *************************************************************************
string defaults_name, attributes_name, conf_section;
register_multiple_conf_default("TM_MAD_CONF");
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
void OpenNebulaTemplate::register_multiple_conf_default(
const std::string& conf_section)
{
string defaults_name, attributes_name;
Attribute * defaults_value;
bool found;
@ -129,8 +135,6 @@ void OpenNebulaTemplate::set_multiple_conf_default()
vector<const Attribute*>::const_iterator iter_attributes;
vector<const Attribute*> attributes_values;
conf_section = "TM_MAD_CONF";
get(conf_section.c_str(), attributes_values);
for( iter_defaults = conf_default.begin();