Skip to content

Commit

Permalink
Merge pull request #22 from arista-eosplus/spec-fixup
Browse files Browse the repository at this point in the history
Clean up spec tests and pull in JJM 14149 #17
  • Loading branch information
privateip committed Jun 5, 2015
2 parents 5e176ae + 05cb83c commit f88738c
Show file tree
Hide file tree
Showing 66 changed files with 819 additions and 344 deletions.
9 changes: 8 additions & 1 deletion lib/puppet/provider/domain_name/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:domain_name).provide(:eos) do

Expand Down
10 changes: 9 additions & 1 deletion lib/puppet/provider/l2_interface/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:l2_interface).provide(:eos) do

# Create methods that set the @property_hash for the #flush method
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/name_server/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:name_server).provide(:eos) do

Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/network_dns/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:network_dns).provide(:eos) do

Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/network_interface/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:network_interface).provide(:eos) do

Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/network_snmp/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:network_snmp).provide(:eos) do

Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/network_trunk/eos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:network_trunk).provide(:eos) do

Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/network_vlan/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:network_vlan).provide(:eos) do

Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/ntp_config/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:ntp_config).provide(:eos) do

Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/ntp_server/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:ntp_server).provide(:eos) do

Expand Down
11 changes: 9 additions & 2 deletions lib/puppet/provider/port_channel/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:port_channel).provide(:eos) do

Expand Down Expand Up @@ -59,7 +66,7 @@ def force=(val)
end

def speed=(val)
not_supported 'spped'
not_supported 'speed'
end

def duplex=(val)
Expand Down
13 changes: 10 additions & 3 deletions lib/puppet/provider/radius/eos.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/eos/provider'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:radius).provide(:eos) do

# Create methods that set the @property_hash for the #flush method
mk_resource_methods

# Mix in the api as instance methods
include PuppetX::Eos::EapiProviderMixin
include PuppetX::NetDev::EosApi

# Mix in the api as class methods
extend PuppetX::Eos::EapiProviderMixin
extend PuppetX::NetDev::EosApi

def self.instances
result = node.api('radius').get
Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/radius_global/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:radius_global).provide(:eos) do

Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/radius_server/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:radius_server).provide(:eos) do

Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/radius_server_group/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:radius_server_group).provide(:eos) do

Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/search_domain/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:search_domain).provide(:eos) do

Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/snmp_community/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:snmp_community).provide(:eos) do

Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/snmp_notification/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:snmp_notification).provide(:eos) do

Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/snmp_notification_receiver/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:snmp_notification_receiver).provide(:eos) do

Expand Down
9 changes: 8 additions & 1 deletion lib/puppet/provider/snmp_user/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:snmp_user).provide(:eos) do

Expand Down
13 changes: 10 additions & 3 deletions lib/puppet/provider/syslog_server/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:syslog_server).provide(:eos) do

Expand Down Expand Up @@ -40,11 +47,11 @@ def source_interface=(val)

def create
node.api('logging').add_host(resource[:name])
@provider_hash = { name: resource[:name], ensure: :present }
@property_hash = { name: resource[:name], ensure: :present }
end

def destroy
node.api('logging').remove_host(resource[:name])
@provider_hash = { name: resource[:name], ensure: :absent }
@property_hash = { name: resource[:name], ensure: :absent }
end
end
9 changes: 8 additions & 1 deletion lib/puppet/provider/syslog_settings/eos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# encoding: utf-8

require 'puppet/type'
require 'puppet_x/net_dev/eos_api'

begin
require "puppet_x/net_dev/eos_api"
rescue LoadError => detail
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require module_base + "../../../" + "puppet_x/net_dev/eos_api"
end

Puppet::Type.type(:syslog_settings).provide(:eos) do

Expand Down
Loading

0 comments on commit f88738c

Please sign in to comment.