Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloning resource attributes for mount[/mnt/data] from prior resource (CHEF-3694) #112

Open
EugenMayer opened this issue Dec 11, 2016 · 4 comments

Comments

@EugenMayer
Copy link

Pretty much the same as https://github.com/chef-cookbooks/apt/pull/214/files

- /tmp/kitchen/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:97:in `action_create'
         Cloning resource attributes for mount[/mnt/data] from prior resource (CHEF-3694)
       Previous mount[/mnt/data]: /tmp/kitchen/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:110:in `action_create'
       Current  mount[/mnt/data]: /tmp/kitchen/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:110:in `action_create' at 1 location:
           - /tmp/kitchen/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:110:in `action_create'

So it should be about https://github.com/chef-cookbooks/lvm/blob/master/libraries/provider_lvm_logical_volume.rb#L110 changed to

mount_resource = mount "cleanup_#{mount_spec[:location]}" do
            location mount_spec[:location]
            options mount_spec[:options]
            dump mount_spec[:dump]
            pass mount_spec[:pass]
            device device_name
            fstype fs_type
            action :nothing
          end

I can provide a PR if someone at least tells me i am going into the right direction

@EugenMayer
Copy link
Author

  # Create the mount point
          dir_resource = directory "cleanup_#{mount_spec[:location]}" do
            path mount_spec[:location]
            mode '755'
            owner 'root'
            group 'root'
            recursive true
            action :nothing
            not_if { Pathname.new(mount_spec[:location]).mountpoint? }
          end
          dir_resource.run_action(:create)
          # Mark the resource as updated if the directory resource is updated
          updates << dir_resource.updated?

          # Mount the logical volume
          mount_resource = mount "cleanup_#{mount_spec[:location]}" do
            mount_point mount_spec[:location]
            dump mount_spec[:dump]
            pass mount_spec[:pass]
            device device_name
            fstype fs_type
            action :nothing
          end

Would be somekind of a thing, but it does not help for me. I do not ge then implicit clone issue at all while reading http://tickets.chef.io/browse/CHEF-3694 so i am stuck in the woods

@MarkGibbons
Copy link
Member

@EugenMayer
It looks like you might have a recipe with multiple logical volume resources that specify the mount point /mnt/data/.

Regards,
Marks

@EugenMayer
Copy link
Author

@markan no, its exactly one - its the only lvm usage at all. Its a very basic (test) recipe

@tas50
Copy link
Contributor

tas50 commented Dec 13, 2016

If we switch to use_inline_resources this will probably go away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants