The "Solaris 10 9/10 release (Update 9)" update changed the output from
the "zpool status" command, which breaks the zpool provider.  The format
basically changed from "vdev" to "vdev-n" (ex: "mirror" to "mirror-0"),
which the current provider doesn't recognize.

This fix changes the way vdev's are checked by the zpool provider, to
support either format.

Signed-off-by: Devon Peters 
<[email protected]<mailto:[email protected]>>
---
lib/puppet/provider/zpool/solaris.rb |   13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/puppet/provider/zpool/solaris.rb 
b/lib/puppet/provider/zpool/solaris.rb
index e597c2a..941f356 100644
--- a/lib/puppet/provider/zpool/solaris.rb
+++ b/lib/puppet/provider/zpool/solaris.rb
@@ -18,12 +18,13 @@ Puppet::Type.type(:zpool).provide(:solaris) do
    #order matters here :(
    pool_array.reverse.each do |value|
      sym = nil
-      case value
-      when "spares"; sym = :spare
-      when "logs"; sym = :log
-      when "mirror", "raidz1", "raidz2"
-        sym = value == "mirror" ? :mirror : :raidz
-        pool[:raid_parity] = "raidz2" if value == "raidz2"
+      if value == "spares"
+        sym = :spare
+      elsif value == "logs"
+        sym = :log
+      elsif value.match(/^mirror|^raidz1|^raidz2/)
+        sym = value.match(/^mirror/) ? :mirror : :raidz
+        pool[:raid_parity] = "raidz2" if value.match(/^raidz2/)
      else
        tmp << value
        sym = :disk if value == pool_array.first
--
1.7.3.2

-- 
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