Sha256: 05e34e6142c02d53e101265a8400afd13b865c790b2ef77ad95b086204de28ed

Contents?: true

Size: 1.31 KB

Versions: 6

Compression:

Stored size: 1.31 KB

Contents

class TestLab

  # Network Error Class
  class NetworkError < TestLabError; end

  # Network Class
  #
  # @author Zachary Patten <zachary AT jovelabs DOT com>
  class Network < ZTK::DSL::Base
    STATUS_KEYS   = %w(id node_id state interface network netmask broadcast provisioners).map(&:to_sym)

    # Sub-Modules
    autoload :Actions,      'testlab/network/actions'
    autoload :Bind,         'testlab/network/bind'
    autoload :ClassMethods, 'testlab/network/class_methods'
    autoload :Provision,    'testlab/network/provision'
    autoload :Status,       'testlab/network/status'

    include TestLab::Network::Actions
    include TestLab::Network::Bind
    include TestLab::Network::Provision
    include TestLab::Network::Status

    extend  TestLab::Network::ClassMethods

    include TestLab::Support::Lifecycle

    include TestLab::Utility::Misc

    # Associations and Attributes
    belongs_to  :node,          :class_name => 'TestLab::Node'
    has_many    :interfaces,    :class_name => 'TestLab::Interface'

    attribute   :provisioners,  :default => Array.new
    attribute   :config,        :default => Hash.new

    attribute   :address
    attribute   :bridge


    def initialize(*args)
      @ui     = TestLab.ui

      super(*args)

      @ui.logger.info { "Network '#{self.id}' Loaded" }
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
testlab-1.3.1 lib/testlab/network.rb
testlab-1.3.0 lib/testlab/network.rb
testlab-1.2.3 lib/testlab/network.rb
testlab-1.2.2 lib/testlab/network.rb
testlab-1.2.1 lib/testlab/network.rb
testlab-1.2.0 lib/testlab/network.rb