class Puppet::SELFileContext

Public Instance Methods

insync?(value) click to toggle source
Calls superclass method Puppet::Property#insync?
# File lib/puppet/type/file/selcontext.rb, line 49
def insync?(value)
  if not selinux_support?
    debug("SELinux bindings not found. Ignoring parameter.")
    true
  elsif not selinux_label_support?(@resource[:path])
    debug("SELinux not available for this filesystem. Ignoring parameter.")
    true
  else
    super
  end
end
retrieve() click to toggle source
# File lib/puppet/type/file/selcontext.rb, line 29
def retrieve
  return :absent unless @resource.stat
  context = self.get_selinux_current_context(@resource[:path])
  parse_selinux_context(name, context)
end
retrieve_default_context(property) click to toggle source
# File lib/puppet/type/file/selcontext.rb, line 35
def retrieve_default_context(property)
  if @resource[:selinux_ignore_defaults] == :true
    return nil
  end

  unless context = self.get_selinux_default_context(@resource[:path])
    return nil
  end

  property_default = self.parse_selinux_context(property, context)
  self.debug "Found #{property} default '#{property_default}' for #{@resource[:path]}" if not property_default.nil?
  property_default
end
sync() click to toggle source
# File lib/puppet/type/file/selcontext.rb, line 61
def sync
  self.set_selinux_context(@resource[:path], @should, name)
  :file_changed
end