Class: Puppet::Provider::Comware::L2vpn

Inherits:
Puppet::Provider::Comware
  • Object
show all
Defined in:
lib/puppet/provider/comware/comware_l2vpn.rb

Instance Method Summary collapse

Instance Method Details

#enable_comware_to_netdev(enable) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/puppet/provider/comware/comware_l2vpn.rb', line 36

def enable_comware_to_netdev(enable)
  case enable
    when 'true'
      true
    else
      false
  end
end

#init_resourceObject



14
15
16
17
18
19
20
21
22
# File 'lib/puppet/provider/comware/comware_l2vpn.rb', line 14

def init_resource
  @ndev_res ||= NetdevComware::Resource.new( self, "L2VPN/Base" )

  ndev_config = @ndev_res.getconfig
  return false unless (ifd = ndev_config.xpath('///Base')[0])

  @ndev_res.set_active_state( ifd )
  return ifd
end

#netdev_res_exists?Boolean

Returns:

  • (Boolean)


5
6
7
8
9
10
11
12
# File 'lib/puppet/provider/comware/comware_l2vpn.rb', line 5

def netdev_res_exists?

  return false unless (ifd = init_resource)

  @ndev_res[:enable] = ifd.xpath('Enable').text.chomp

  return enable_comware_to_netdev(@ndev_res[:enable])
end

#netdev_resxml_create_top(xml) ⇒ Object



28
29
30
# File 'lib/puppet/provider/comware/comware_l2vpn.rb', line 28

def netdev_resxml_create_top( xml )
  xml.Enable 'true'
end

#netdev_resxml_delete(xml) ⇒ Object



32
33
34
# File 'lib/puppet/provider/comware/comware_l2vpn.rb', line 32

def netdev_resxml_delete( xml )
  xml.Enable 'false'
end

#netdev_resxml_top(xml) ⇒ Object

override the method



25
26
# File 'lib/puppet/provider/comware/comware_l2vpn.rb', line 25

def netdev_resxml_top( xml )
end