Class: OsCtld::Assets::UnixSocket

Inherits:
BaseFile show all
Defined in:
lib/osctld/assets/unix_socket.rb

Instance Attribute Summary

Attributes inherited from Base

#errors, #opts, #path

Instance Method Summary collapse

Methods inherited from BaseFile

#exist?, #initialize, #mode, #stat

Methods inherited from Base

#add_error, #initialize, #prefetch_zfs, register, #run_validation, #state, #type, #valid?, #validate?, #validate_block

Constructor Details

This class inherits a constructor from OsCtld::Assets::BaseFile

Instance Method Details

#validate(run) ⇒ Object (protected)



9
10
11
12
13
14
15
16
17
# File 'lib/osctld/assets/unix_socket.rb', line 9

def validate(run)
  begin
    add_error('not a socket') if exist? && !opts[:optional] && !stat.socket?
  rescue Errno::ENOENT
    add_error('does not exist')
  end

  super
end