]> granicus.if.org Git - icinga2/commitdiff
Remove redundand check for object existence on creation via API 6808/head
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Thu, 29 Nov 2018 16:51:53 +0000 (17:51 +0100)
committerAlexander A. Klimov <alexander.klimov@icinga.com>
Thu, 29 Nov 2018 16:51:53 +0000 (17:51 +0100)
refs #3937

lib/remote/configobjectutility.cpp

index 1fc8dcb925a6880fda4d901d17ddc8e94ede6c2d..708ec03036c60992bc9f79e6d52da71875bbaa59 100644 (file)
@@ -120,11 +120,6 @@ bool ConfigObjectUtility::CreateObject(const Type::Ptr& type, const String& full
        String path = GetObjectConfigPath(type, fullName);
        Utility::MkDirP(Utility::DirName(path), 0700);
 
-       if (Utility::PathExists(path)) {
-               errors->Add("Cannot create object '" + fullName + "'. Configuration file '" + path + "' already exists.");
-               return false;
-       }
-
        std::ofstream fp(path.CStr(), std::ofstream::out | std::ostream::trunc);
        fp << config;
        fp.close();