Fix regression with e165ea9
Commit e165ea9 introduces creation of the remote logging config file on
demand, but it presumed the directory housing this config file
pre-exists. That was not the case.
Change-Id: I8974ce798de5d2747bcc4a67209f4d2c8081cfe6
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/phosphor-rsyslog-config/server-conf.cpp b/phosphor-rsyslog-config/server-conf.cpp
index e8da82e..16955fc 100644
--- a/phosphor-rsyslog-config/server-conf.cpp
+++ b/phosphor-rsyslog-config/server-conf.cpp
@@ -108,6 +108,7 @@
void Server::writeConfig(const std::string& serverAddress, uint16_t serverPort,
const char* filePath)
{
+ fs::create_directory(fs::path(filePath).parent_path());
std::fstream stream(filePath, std::fstream::out);
if (serverPort && !serverAddress.empty())