Use MkDirP instead of MkDir when syncing zone configs

fixes #10932
This commit is contained in:
Gunnar Beutner 2016-01-26 10:45:03 +01:00
parent a19527f109
commit 5c23beb6a9
1 changed files with 2 additions and 2 deletions

View File

@ -134,7 +134,7 @@ void ApiListener::SyncZoneDir(const Zone::Ptr& zone) const
Log(LogInformation, "ApiListener") Log(LogInformation, "ApiListener")
<< "Copying " << newConfig->GetLength() << " zone configuration files for zone '" << zone->GetName() << "' to '" << oldDir << "'."; << "Copying " << newConfig->GetLength() << " zone configuration files for zone '" << zone->GetName() << "' to '" << oldDir << "'.";
Utility::MkDir(oldDir, 0700); Utility::MkDirP(oldDir, 0700);
Dictionary::Ptr oldConfig = LoadConfigDir(oldDir); Dictionary::Ptr oldConfig = LoadConfigDir(oldDir);
@ -240,7 +240,7 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const D
String oldDir = Application::GetLocalStateDir() + "/lib/icinga2/api/zones/" + zone->GetName(); String oldDir = Application::GetLocalStateDir() + "/lib/icinga2/api/zones/" + zone->GetName();
Utility::MkDir(oldDir, 0700); Utility::MkDirP(oldDir, 0700);
Dictionary::Ptr newConfig = kv.second; Dictionary::Ptr newConfig = kv.second;
Dictionary::Ptr oldConfig = LoadConfigDir(oldDir); Dictionary::Ptr oldConfig = LoadConfigDir(oldDir);