class Junos::Ez::L2ports::Provider

Public Instance Methods

is_trunk?() click to toggle source

common parenting …

# File lib/junos-ez/l2_ports.rb, line 33
def is_trunk?
  @has[:vlan_tagging] == true
end
mode_changed?() click to toggle source
# File lib/junos-ez/l2_ports.rb, line 41
def mode_changed?
  return true if is_new?
  return false if @should[:vlan_tagging].nil?      
  @should[:vlan_tagging] != @has[:vlan_tagging]      
end
should_trunk?() click to toggle source
# File lib/junos-ez/l2_ports.rb, line 37
def should_trunk?
  (@should[:vlan_tagging].nil?) ? @has[:vlan_tagging] : @should[:vlan_tagging]
end
xml_change__active( xml ) click to toggle source

XML overload 'activate/deactivate' since we need to modify this at the 'unit' level and not at the 'family' level


# File lib/junos-ez/l2_ports.rb, line 52
def xml_change__active( xml )
  par = xml.instance_variable_get(:@parent).at_xpath('ancestor::interface')
  value = @should[:_active]  ? 'active' : 'inactive'
  par[value] = value # attribute name is same as value
end