Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-1931

mount provider improvement when options property is not specified

    Details

    • Template:
    • Story Points:
      5
    • Sprint:
      RE 2015-04-08, RE 2015-04-22, RE 2015-05-06, RE 2015-05-20
    • Release Notes:
      Bug Fix

      Description

      Not specifying options to a mount resource results in an opaque error message because it creates a bogus fstab without an options field.

      E.g. I create a loop mountable ext2 filsystem on a CentOS 6 VM and verified that error message when not specifying options and that it goes away if you do specify (correct) options:

      [root@qolo808yryboag9 puppet]# bundle exec puppet apply -e 'mount { "/mnt/loop": ensure => "mounted", fstype => "ext2", device => "/root/1m" } '
      Notice: Compiled catalog for qolo808yryboag9.delivery.puppetlabs.net in environment production in 0.07 seconds
      Notice: /Stage[main]//Mount[/mnt/loop]/ensure: ensure changed 'unmounted' to 'mounted'
      Error: /Stage[main]//Mount[/mnt/loop]: Could not evaluate: Execution of '/bin/mount /mnt/loop' returned 32: mount: /root/1m is not a block device (maybe try `-o loop'?)
       
      Notice: Finished catalog run in 0.10 seconds
      

      vs

      [root@qolo808yryboag9 puppet]# bundle exec puppet apply -e 'mount { "/mnt/loop": ensure => "mounted", fstype => "ext2", device => "/root/1m", options => "loop,sync,noatime" } '
      Notice: Compiled catalog for qolo808yryboag9.delivery.puppetlabs.net in environment production in 0.06 seconds
      Notice: /Stage[main]//Mount[/mnt/loop]/ensure: ensure changed 'unmounted' to 'mounted'
      Notice: /Stage[main]//Mount[/mnt/loop]: Triggered 'refresh' from 1 events
      Notice: Finished catalog run in 0.09 seconds
      

      We could improve this by generating a more indicative error message and not adding the bogus fstab entry.
      2) error out rather than creating

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                kylo Kylo Ginsberg
                QA Contact:
                Eric Thompson
              • Votes:
                1 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: