Class: Staypuft::VipNic

Inherits:
Nic::Managed
  • Object
show all
Defined in:
app/models/staypuft/vip_nic.rb

Instance Method Summary collapse

Instance Method Details

#require_host?Boolean

VIP nic is associated with the deployment, not the host

Returns:

  • (Boolean)


9
10
11
# File 'app/models/staypuft/vip_nic.rb', line 9

def require_host?
  false
end

#reserve_ipObject



12
13
14
15
16
# File 'app/models/staypuft/vip_nic.rb', line 12

def reserve_ip
  if self.subnet.present? && self.subnet.ipam? && (!self.ip || self.subnet_id_changed?)
    self.ip = self.subnet.unused_ip
  end
end