Class: Puppet::Property::VDev
- Inherits:
-
Puppet::Property
- Object
- Puppet::Property
- Puppet::Property::VDev
- Defined in:
- lib/puppet/type/zpool.rb
Overview
VDev class
Direct Known Subclasses
Instance Method Summary collapse
-
#flatten_and_sort(array) ⇒ Array
Returns a flattened and sorted array.
-
#insync?(is) ⇒ Boolean
If the resource is in sync with what it should be.
Instance Method Details
#flatten_and_sort(array) ⇒ Array
Returns a flattened and sorted array
9 10 11 12 |
# File 'lib/puppet/type/zpool.rb', line 9 def flatten_and_sort(array) array = [array] unless array.is_a? Array array.map { |a| a.split(' ') }.flatten.sort end |
#insync?(is) ⇒ Boolean
Returns if the resource is in sync with what it should be.
16 17 18 19 20 |
# File 'lib/puppet/type/zpool.rb', line 16 def insync?(is) return @should == [:absent] if is == :absent flatten_and_sort(is) == flatten_and_sort(@should) end |