]> granicus.if.org Git - icinga2/commitdiff
Config sync: Only copy paths to prod which are actually there
authorMichael Friedrich <michael.friedrich@icinga.com>
Wed, 19 Jun 2019 15:00:50 +0000 (17:00 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Wed, 19 Jun 2019 15:00:50 +0000 (17:00 +0200)
Stored files may be removed by external sources.

lib/remote/apilistener-filesync.cpp

index 42c4737fe6048b58fcdd9343474cdae2e97266b0..f3d5a5d48b094c020f8f4cfb1f53435406a81b5b 100644 (file)
@@ -547,6 +547,9 @@ void ApiListener::TryActivateZonesStageCallback(const ProcessResult& pr,
 
                // Copy all synced configuration files from stage to production.
                for (const String& path : relativePaths) {
+                       if (!Utility::PathExists(path))
+                               continue;
+
                        Log(LogInformation, "ApiListener")
                                << "Copying file '" << path << "' from config sync staging to production zones directory.";