Catch empty *info when we get it from the functions in modules/deprecated
authorPeter Palfrader <peter@palfrader.org>
Tue, 15 Oct 2019 11:01:35 +0000 (13:01 +0200)
committerPeter Palfrader <peter@palfrader.org>
Tue, 15 Oct 2019 11:01:50 +0000 (13:01 +0200)
modules/deprecated/manifests/init.pp

index f29c765..df4a438 100644 (file)
@@ -3,4 +3,14 @@ class deprecated {
        $localinfo = yamlinfo('*')
        $nodeinfo  = nodeinfo($::fqdn)
        $allnodeinfo = allnodeinfo('sshRSAHostKey ipHostNumber', 'purpose mXRecord physicalHost purpose')
+
+       if ! ($localinfo.size > 0) {
+               fail('Cannot learn localinfo.')
+       }
+       if ! ($nodeinfo.size > 0) {
+               fail('Cannot learn nodeinfo.')
+       }
+       if ! ($allnodeinfo.size > 0) {
+               fail('Cannot learn allnodeinfo.')
+       }
 }