Sha256: 943cca67235f1b2c87e46eb34df5f97766d2fd0705953184bde0a24f64b78c8c
Contents?: true
Size: 669 Bytes
Versions: 16
Compression:
Stored size: 669 Bytes
Contents
require 'mkit/status' require 'mkit/exceptions' require 'mkit/app/helpers/interface_helper' class Lease < ActiveRecord::Base belongs_to :pool belongs_to :service before_destroy :down def confirm self.status = MKIt::PoolStatus::IN_USE end def up MKIt::InterfaceHelper.create(name: interface_name, ctype: interface_type) MKIt::InterfaceHelper.up(name: interface_name, ip: ip, mask: pool.netmask) self.status = MKIt::PoolStatus::IN_USE end def down MKIt::InterfaceHelper.down(name: interface_name) MKIt::InterfaceHelper.remove(name: interface_name, ctype: interface_type) self.status = MKIt::PoolStatus::RESERVED end end
Version data entries
16 entries across 16 versions & 1 rubygems