Cli: Ignore 'import' attribute on repository add validation

refs #7458
This commit is contained in:
Michael Friedrich 2014-10-28 12:17:09 +01:00
parent 2db549d976
commit cb6a4f1c76
2 changed files with 1 additions and 1 deletions

View File

@ -189,7 +189,6 @@ int RepositoryObjectCommand::Run(const boost::program_options::variables_map& vm
attrs->Set("import", imports);
}
if (m_Command == RepositoryCommandAdd) {
Utility::LoadExtensionLibrary("icinga");
RepositoryUtility::AddObject(name, m_Type, attrs);

View File

@ -219,6 +219,7 @@ bool RepositoryUtility::AddObject(const String& name, const String& type, const
Dictionary::Ptr vattrs = attrs->ShallowClone();
vattrs->Set("__name", vattrs->Get("name"));
vattrs->Remove("name");
vattrs->Remove("import");
vattrs->Set("type", type);
RepositoryTypeRuleUtilities utils;