Class: Puppet::Property::MultiVDev

Inherits:
VDev show all
Defined in:
lib/puppet/type/zpool.rb

Overview

MultiVDev class

Instance Method Summary collapse

Methods inherited from VDev

#flatten_and_sort

Instance Method Details

#insync?(is) ⇒ Boolean

Returns if the resource is in sync with what it should be.

Parameters:

  • is

    the current state of the object

Returns:

  • (Boolean)

    if the resource is in sync with what it should be



27
28
29
30
31
32
33
34
35
36
# File 'lib/puppet/type/zpool.rb', line 27

def insync?(is)
  return @should == [:absent] if is == :absent

  return false unless is.length == @should.length

  is.each_with_index { |list, i| return false unless flatten_and_sort(list) == flatten_and_sort(@should[i]) }

  # if we made it this far we are in sync
  true
end