voxpupuli/puppet-corosync

clone of a group isn't supported

Closed this issue · 0 comments

tdb commented

When trying to clone a group I see the error:

Error: Could not prefetch cs_clone provider 'crm': undefined method `attributes' for nil:NilClass

The configuration looks like:

group g_nfs p_rpcbind p_nfs_kernel_server
clone cl_nfs g_nfs \
        meta interleave="true"

And the XML:

      <clone id="cl_nfs">
...
        <group id="g_nfs">
          <primitive id="p_rpcbind" class="lsb" type="rpcbind">

So the primitive is a level deeper than it would be with a clone of a primitive. The following code in https://github.com/puppet-community/puppet-corosync/blob/master/lib/puppet/provider/cs_clone/crm.rb#L41 expects the primitive to be directly under clone:

    doc.root.elements['configuration'].elements['resources'].each_element('clone') do |e|
      primitive_id = e.elements['primitive'].attributes['id']

It appears to be the same for pcs too, although I've not tested it.

I don't have a fix, so just documenting the issue so others will be aware.