Class: Puppet::Property::VDev

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

Direct Known Subclasses

MultiVDev

Constant Summary

Constants included from Util::Docs

Util::Docs::HEADER_LEVELS

Constants included from Util

Util::AbsolutePathPosix, Util::AbsolutePathWindows

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

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, #property_matches?, #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, #fail, format_value_for_display, #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, #markdown_definitionlist, #markdown_header, #nodoc?, #pad, scrub

Methods included from Util

absolute_path?, activerecord_version, benchmark, binread, chuser, classproxy, #execfail, #execpipe, execute, execute_posix, execute_windows, logmethods, memory, path_to_uri, proxy, replace_file, safe_posix_fork, symbolize, symbolizehash, symbolizehash!, synchronize_on, thinmark, #threadlock, uri_to_path, wait_for_output, which, withumask

Methods included from Util::POSIX

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

Methods included from Util::MethodHelper

#requiredopts, #set_options, #symbolize_options

Methods included from Util::Logging

#clear_deprecation_warnings, #deprecation_warning, #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
9
# File 'lib/vendor/puppet/type/zpool.rb', line 6

def flatten_and_sort(array)
  array = [array] unless array.is_a? Array
  array.collect { |a| a.split(' ') }.flatten.sort
end

#insync?(is) ⇒ Boolean

Returns:

  • (Boolean)


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

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

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