* runtime production config and newly received configuration.
*/
String apiZonesStageDir = GetApiZonesStageDir();
- Utility::RemoveDirRecursive(apiZonesStageDir);
+
+ if (Utility::PathExists(apiZonesStageDir))
+ Utility::RemoveDirRecursive(apiZonesStageDir);
+
Utility::MkDirP(apiZonesStageDir, 0700);
ObjectLock olock(updateV1);
String apiZonesDir = GetApiZonesDir();
/* Purge production before copying stage. */
- Utility::RemoveDirRecursive(apiZonesDir);
+ if (Utility::PathExists(apiZonesDir))
+ Utility::RemoveDirRecursive(apiZonesDir);
+
Utility::MkDirP(apiZonesDir, 0700);
/* Copy all synced configuration files from stage to production. */