~ubuntu-branches/ubuntu/trusty/puppet/trusty

« back to all changes in this revision

Viewing changes to lib/puppet/provider/mount/parsed.rb

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-10-22 14:08:22 UTC
  • mfrom: (1.1.25) (3.1.32 sid)
  • Revision ID: package-import@ubuntu.com-20111022140822-odxde5lohc45yhuz
Tags: 2.7.6-1
* New upstream release (CVE-2011-3872)
* Remove cherry-picked "groupadd_aix_warning" patch
* Install all new manpages

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
  commands :mountcmd => "mount", :umount => "umount"
20
20
 
21
 
  case Facter["operatingsystem"]
 
21
  case Facter.value(:operatingsystem)
22
22
  when "Solaris"
23
23
    @fields = [:device, :blockdevice, :name, :fstype, :pass, :atboot, :options]
24
24
  else
47
47
    end
48
48
  end
49
49
 
 
50
  def self.instances
 
51
    providers = super
 
52
    mounts = mountinstances.dup
 
53
 
 
54
    # Update fstab entries that are mounted
 
55
    providers.each do |prov|
 
56
      if mounts.delete({:name => prov.get(:name), :mounted => :yes}) then
 
57
        prov.set(:ensure => :mounted)
 
58
      end
 
59
    end
 
60
 
 
61
    # Add mounts that are not in fstab but mounted
 
62
    mounts.each do |mount|
 
63
      providers << new(:ensure => :ghost, :name => mount[:name])
 
64
    end
 
65
    providers
 
66
  end
 
67
 
50
68
  def self.prefetch(resources = nil)
51
69
    # Get providers for all resources the user defined and that match
52
70
    # a record in /etc/fstab.