Class: AutomateIt::AddressManager::SunOS

Inherits:
BaseDriver show all
Defined in:
lib/automateit/address_manager/sunos.rb

Overview

AddressManager::SunOS

A SunOS-specific driver for the AddressManager provides complete support for querying, adding and removing addresses.

Constant Summary

Constants inherited from Plugin::Driver

Plugin::Driver::BASE_DRIVER_NAME

Constants included from Constants

Constants::HELPERS_DIR, Constants::INSTALL_DIR, Constants::PERROR, Constants::PEXEC, Constants::PNOTE, Constants::WARNING_BOILERPLATE

Instance Attribute Summary

Attributes inherited from Plugin::Driver

#manager

Attributes inherited from Common

#interpreter

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseDriver

#has?, #hostnames, #hostnames_for

Methods inherited from Plugin::Driver

abstract_driver, #available?, base_driver, base_driver?, depends_on, inherited, manager_token, #setup

Methods inherited from Plugin::Base

#setup, #token

Methods inherited from Common

#initialize, #log, #nitpick, #noop, #noop=, #noop?, #preview, #preview=, #preview?, #preview_for, #setup, #superuser?, #writing, #writing=, #writing?

Constructor Details

This class inherits a constructor from AutomateIt::Common

Class Method Details

.tokenObject



6
7
8
# File 'lib/automateit/address_manager/sunos.rb', line 6

def self.token
  :sunos
end

Instance Method Details

#add(opts) ⇒ Object

See AddressManager#add



19
20
21
22
23
24
# File 'lib/automateit/address_manager/sunos.rb', line 19

def add(opts)
  _add_helper(opts) do |opts|
    interpreter.sh("ifconfig %s plumb" % _interface_and_label(opts))
    interpreter.sh(_ifconfig_helper(:add, opts))
  end
end

#remove(opts) ⇒ Object

See AddressManager#remove



27
28
29
30
31
32
33
# File 'lib/automateit/address_manager/sunos.rb', line 27

def remove(opts)
  _remove_helper(opts) do |opts|
    interpreter.sh(_ifconfig_helper(:remove, opts))
    interpreter.sh("ifconfig %s unplumb" % _interface_and_label(opts))
    true
  end
end

#suitability(method, *args) ⇒ Object

:nodoc:



13
14
15
16
# File 'lib/automateit/address_manager/sunos.rb', line 13

def suitability(method, *args) # :nodoc:
  # Must be higher than AddressManager::BSD 
  available? ? 3 : 0
end