diff options
| author | Devon Peters <devon.peters@e-hps.com> | 2010-12-14 14:05:55 -0800 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2011-03-01 12:15:59 -0800 |
| commit | b1d97284d0fea1cbcc52bc55117a4b1ad3cf385b (patch) | |
| tree | be1bb3bef30761b802bc19adf05b87a54c2cb739 /lib | |
| parent | 4b35402ba85d8842d757becec5c8a7bf4d6f6654 (diff) | |
| download | puppet-b1d97284d0fea1cbcc52bc55117a4b1ad3cf385b.tar.gz puppet-b1d97284d0fea1cbcc52bc55117a4b1ad3cf385b.tar.xz puppet-b1d97284d0fea1cbcc52bc55117a4b1ad3cf385b.zip | |
(#5496) zpool provider supports new 'zpool status' format
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.
Reviewed-By: Nick Lewis
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/puppet/provider/zpool/solaris.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/puppet/provider/zpool/solaris.rb b/lib/puppet/provider/zpool/solaris.rb index e597c2ae1..758ea618a 100644 --- a/lib/puppet/provider/zpool/solaris.rb +++ b/lib/puppet/provider/zpool/solaris.rb @@ -19,11 +19,13 @@ Puppet::Type.type(:zpool).provide(:solaris) do 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" + when "spares"; + sym = :spare + when "logs"; + sym = :log + when /^mirror|^raidz1|^raidz2/; + sym = value =~ /^mirror/ ? :mirror : :raidz + pool[:raid_parity] = "raidz2" if value =~ /^raidz2/ else tmp << value sym = :disk if value == pool_array.first |
