From cb6a4f1c76fcb486915800360e83a05d920281e5 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Tue, 28 Oct 2014 12:17:09 +0100 Subject: [PATCH] Cli: Ignore 'import' attribute on repository add validation refs #7458 --- lib/cli/repositoryobjectcommand.cpp | 1 - lib/cli/repositoryutility.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli/repositoryobjectcommand.cpp b/lib/cli/repositoryobjectcommand.cpp index 444d9e9fa..e7bd3cdb2 100644 --- a/lib/cli/repositoryobjectcommand.cpp +++ b/lib/cli/repositoryobjectcommand.cpp @@ -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); diff --git a/lib/cli/repositoryutility.cpp b/lib/cli/repositoryutility.cpp index ffef6dc5e..88936266f 100644 --- a/lib/cli/repositoryutility.cpp +++ b/lib/cli/repositoryutility.cpp @@ -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;