diff --git a/include/PoolObjectSQL.h b/include/PoolObjectSQL.h index 69be01e049..31428d4577 100644 --- a/include/PoolObjectSQL.h +++ b/include/PoolObjectSQL.h @@ -140,7 +140,7 @@ public: return name; }; - virtual void set_name(const string& _name) + void set_name(const string& _name) { name = _name; }; diff --git a/include/VMTemplate.h b/include/VMTemplate.h index 5a18ef4893..b48f7ddb75 100644 --- a/include/VMTemplate.h +++ b/include/VMTemplate.h @@ -59,12 +59,6 @@ public: *(static_cast(obj_template))); }; - virtual void set_name(const string& _name) - { - name = _name; - replace_template_attribute("TEMPLATE_NAME", name); - }; - private: // ------------------------------------------------------------------------- // Friends diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index 43b9cf4059..e770a97259 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -230,16 +230,8 @@ int VirtualMachine::insert(SqlDB * db, string& error_str) if ( name.empty() == true ) { - string prefix; - get_template_attribute("TEMPLATE_NAME",prefix); - - if ( prefix.empty() ) - { - prefix = "one"; - } - oss.str(""); - oss << prefix << "-" << oid; + oss << "one-" << oid; name = oss.str(); replace_template_attribute("NAME", name); diff --git a/src/vm_template/VMTemplate.cc b/src/vm_template/VMTemplate.cc index 2e6f0f879e..6cbd0b900e 100644 --- a/src/vm_template/VMTemplate.cc +++ b/src/vm_template/VMTemplate.cc @@ -98,8 +98,6 @@ int VMTemplate::insert(SqlDB *db, string& error_str) return -1; } - replace_template_attribute("TEMPLATE_NAME", name); - // ------------------------------------------------------------------------ // Insert the Template // ------------------------------------------------------------------------