Class: Puppet::Property::VDev

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

Direct Known Subclasses

MultiVDev

Instance Attribute Summary

Attributes inherited from Puppet::Property

#noop, #shadow, #shouldorig

Attributes inherited from Puppet::Parameter

#parent, #resource

Attributes included from Util::Docs

#doc, #nodoc

Attributes included from Util::Cacher::Expirer

#timestamp

Instance Method Summary collapse

Methods inherited from Puppet::Property

array_matching, array_matching=, #call_provider, #call_valuemethod, #change_to_s, #event, #event_name, #initialize, #is_to_s, #log, #match_all?, method_added, #munge, #name, newvalue, #retrieve, #safe_insync?, #set, #setup_shadow, #should, #should=, #should_to_s, #sync, #unsafe_validate, #validate_features_per_value, #value, #value=, value_name, value_option

Methods inherited from Puppet::Parameter

aliasvalue, defaultto, desc, #devfail, doc, #expirer, #fail, #initialize, initvars, isnamevar, isnamevar?, isrequired, #log, #metaparam?, #munge, munge, #name, newvalues, nodefault, #noop, #pathbuilder, #provider, proxymethods, #remove, required?, #tags, #to_s, unmunge, #unmunge, #unsafe_munge, #unsafe_validate, validate, #validate, #value, #value=

Methods included from Util::Docs

#desc, #dochook, #doctable, #nodoc?, #pad, scrub

Methods included from Util

activerecord_version, benchmark, chuser, classproxy, #execfail, #execpipe, execute, logmethods, memory, proxy, recmkdir, secure_open, symbolize, symbolizehash, symbolizehash!, synchronize_on, thinmark, #threadlock, which, withumask

Methods included from Util::POSIX

#get_posix_field, #gid, #idfield, #methodbyid, #methodbyname, #search_posix_field, #uid

Methods included from Util::Cacher

extended, included

Methods included from Util::Cacher::Expirer

#dependent_data_expired?, #expire

Methods included from Util::MethodHelper

#requiredopts, #set_options, #symbolize_options

Methods included from Util::Logging

#send_log

Methods included from Util::LogPaths

#path, #source_descriptors

Methods included from Util::Errors

#adderrorcontext, #devfail, #error_context, #exceptwrap, #fail

Constructor Details

This class inherits a constructor from Puppet::Property

Instance Method Details

#flatten_and_sort(array) ⇒ Object



6
7
8
# File 'lib/puppet/type/zpool.rb', line 6

def flatten_and_sort(array)
  array.collect { |a| a.split(' ') }.flatten.sort
end

#insync?(is) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
14
# File 'lib/puppet/type/zpool.rb', line 10

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

  flatten_and_sort(is) == flatten_and_sort(@should)
end