]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
trust_anchors: unify warning about 0 trust anchors
authorPetr Špaček <petr.spacek@nic.cz>
Fri, 21 Dec 2018 08:46:25 +0000 (09:46 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 9 Jan 2019 15:24:00 +0000 (16:24 +0100)
daemon/lua/trust_anchors.lua.in

index e70649d1e17cf719991d55a7ae9f682927143612..480b66a69370625f76e9c080f86545b9794f6015 100644 (file)
@@ -416,6 +416,10 @@ local function keyset_publish(keyset)
                        end
                end
        end
+       if count == 0 then
+               warn('[ ta ] ERROR: no anchors are trusted for ' ..
+                    kres.dname2str(keyset.owner) .. ' !')
+       end
        return count
 end
 
@@ -470,8 +474,6 @@ update = function (keyset, new_keys, is_initial)
 
        -- Start using the new TAs.
        if keyset_publish(keyset) == 0 then
-               warn('[ ta ] WARNING: no anchors for ' .. kres.dname2str(keyset.owner)
-                       .. ' are trusted!')
                -- TODO: try to rebootstrap if for root?
                return false
        end
@@ -541,8 +543,7 @@ local add_file = function (path, unmanaged)
 
        -- Parse new keys, refresh eventually
        if keyset_publish(keyset) == 0 then
-               warn('[ ta ] ERROR: anchors are trusted for ' .. owner_str .. ' !')
-               -- TODO: try to rebootstrap?
+               -- TODO: try to rebootstrap if for root?
        end
        refresh_plan(keyset, 10 * sec, false)
 end