Issue #18399 has been updated by Nick Fagerlund.

Subject changed from Chained resources with empty collections to Empty resource 
collectors can break long relationship chains

----------------------------------------
Bug #18399: Empty resource collectors can break long relationship chains
https://projects.puppetlabs.com/issues/18399#change-101156

* Author: Martin Collins
* Status: Unreviewed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
Hi,

When using chained resources, with a collection within the string, if the 
collection is empty, the chain is broken and the resources either side do not 
depend on each other.

Example:

test/manifests/init.pp
    class test {
      $cr = ["1", "2"]
  
      exec{"pre":
        command => "/bin/true"
      }
  
      exec{"post":
        command => "/bin/true"
      }
  
      test::test{$cr: }
  
      Exec["pre"] 
        -> Exec<| tag == 'inter' |> 
          -> Exec["post"]
    }

test/manifests/test.pp
    define test::test{
      exec{"echo $name":
        command => "/bin/echo $name",
        tag     => "inter"
      }
    }

Run as is:

!non_empty_collection.jpg!

If we comment out:

    test::test{$cr: }

So it is empty, we get "empty_collection.jpg", this:

!empty_collection.jpg!

To get the desired result and what I would have expected as the default, I have 
to manually add another relationship between "pre" and "post" to cater for the 
empty collection.

    Exec["pre"] 
      -> Exec<| tag == 'inter' |> 
        -> Exec["post"]

    Exec["pre"]
      -> Exec["post"]

Resulting in:

!workaround.jpg!

Is this the intended behaviour? I would expect the workaround relationship to 
be implicit (Pre -> a collection that happens to be empty -> post), as I do not 
know how many tags of "inter" will be created (in my real use, this is pulled 
from hiera)

Thanks,
Martin


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to