Greetings!

Please review the pull request #1: Added support for mountpoint type on linux and added some docs. opened by (ahpook)

Some more information about the pull request:

  • Opened: Sat Sep 10 00:29:25 UTC 2011
  • Based on: puppetlabs:master (e370ffb4295bda937894a1df203c73233481bbba)
  • Requested merge: ahpook:docs-and-linux (3401cfcd3ccd18f22c4add2f80fda8dc1ce685ae)

Description:

Hi all, I got a chance to exercise this today. I added support for Linux, based on the Solaris provider, plus updated the @doc strings in both types.

Seems to work pretty well, I couldn't exercise the full codebase but it definitely fixed #6309.

Thanks!
The Pull Request Bot

Diff follows:

diff --git a/lib/puppet/provider/mountpoint/linux.rb b/lib/puppet/provider/mountpoint/linux.rb
new file mode 100644
index 0000000..704e888
--- /dev/null
+++ b/lib/puppet/provider/mountpoint/linux.rb
@@ -0,0 +1,18 @@
+require 'puppet/type/mountpoint'
+require 'puppet/provider/mountpoint'
+
+Puppet::Type.type(:mountpoint).provide(:linux, :parent => Puppet::Provider::Mountpoint) do
+  commands :mount => "mount", :unmount => "umount"
+
+  confine :kernel => :linux
+
+  private
+
+  def entry
+    line = mount.split("\n").find do |line|
+      File.expand_path(line.split[2]) == File.expand_path(resource[:name])
+    end
+    line =~ /^(\S*) on (\S*) type (\S*) (?:\((\S+)\))?/
+    {:device => $1, :name => $2, :options => $4}
+  end
+end
diff --git a/lib/puppet/type/mountpoint.rb b/lib/puppet/type/mountpoint.rb
index 9ea2451..bdacaf1 100644
--- a/lib/puppet/type/mountpoint.rb
+++ b/lib/puppet/type/mountpoint.rb
@@ -1,5 +1,8 @@
 module Puppet
   newtype(:mountpoint) do
+    @doc = "Manages currently mounted volumes, i.e. the live state of the filesystem.
+See the discussion under the mounttab type for usage."
+
     feature :refreshable, "The provider can remount the filesystem.",
       :methods => [:remount]
 
diff --git a/lib/puppet/type/mounttab.rb b/lib/puppet/type/mounttab.rb
index a1cdb3e..64facd9 100755
--- a/lib/puppet/type/mounttab.rb
+++ b/lib/puppet/type/mounttab.rb
@@ -3,7 +3,13 @@ require 'puppet/provider/parsedfile'
 
 module Puppet
   newtype(:mounttab) do
-    @doc = "Manages entries in the filesystem table."
+    @doc = "Manages entries in the filesystem table. This is usually, but not
+necessarily, used in conjunction with the mountpoint type to manage both the
+current-running state of mounts (mountpoint) with the fstab entries which load
+them at boot time (mounttab). An easy way to manage both at the same time
+is with a defined type that wraps both resources in one call, since the three most
+important options (the device name, the mountpoint, and any mount options) are
+shared between the two types."
 
     ensurable
 

    

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to