specinfra-cisco 2.40.2 → 2.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d09c36dc095d0a42ceac4b149746d91ad6db6008
4
- data.tar.gz: b78b024cd01f1b2a994a7a270dc01883a7836cd3
3
+ metadata.gz: a991ffaf12d256b0704f96f536017f6ef0638a5e
4
+ data.tar.gz: eff125e85bbaaed2631d31dd1221ef4714278193
5
5
  SHA512:
6
- metadata.gz: 14821d240deeaf6518e178400fa0db34ac0d2ae43bef9a06f589d7625b46737816348ec55ca4c743e5fb4d67b1769e8b568e7f11e50c52ac209fc78ed73e9300
7
- data.tar.gz: 109360950c464ae2dd967d80a0944abc17fd86a49e7e4e67509c8ba1787799795a139bbd590c5241f76928fee9fa8168960142bbb9768dc324686a689eb92b6a
6
+ metadata.gz: 581f33a0c5e989ea93d5eb0d35655e830d8557247e14805d35d2a470ed121a5c64ba7348f09a9bef6b8a3aedca3068b5211c542ebc27e87f7429587c3e660e8e
7
+ data.tar.gz: 31ff5ea8d56e503a5a53fd30745b8331f9a2a26807018c03178e54548071cf7768378a27dd4d2ba39381f6a75373e27735fc6eb2884f0a24a100dffd47510453
@@ -218,6 +218,18 @@ require 'specinfra/command/nexus/base/port'
218
218
  require 'specinfra/command/nexus/base/package'
219
219
  require 'specinfra/command/nexus/base/yumrepo'
220
220
 
221
+ # IOS-XR (inherit Linux)
222
+ require 'specinfra/command/ios_xr'
223
+ require 'specinfra/command/ios_xr/base'
224
+ require 'specinfra/command/ios_xr/base/host'
225
+ require 'specinfra/command/ios_xr/base/file'
226
+ require 'specinfra/command/ios_xr/base/host'
227
+ require 'specinfra/command/ios_xr/base/iptables'
228
+ require 'specinfra/command/ios_xr/base/service'
229
+ require 'specinfra/command/ios_xr/base/port'
230
+ require 'specinfra/command/ios_xr/base/package'
231
+ require 'specinfra/command/ios_xr/base/yumrepo'
232
+
221
233
  # FreeBSD (inherit Base)
222
234
  require 'specinfra/command/freebsd'
223
235
  require 'specinfra/command/freebsd/base'
@@ -0,0 +1 @@
1
+ class Specinfra::Command::Ios_xr;end
@@ -0,0 +1,2 @@
1
+ class Specinfra::Command::Ios_xr::Base < Specinfra::Command::Linux::Base
2
+ end
@@ -0,0 +1,8 @@
1
+ class Specinfra::Command::Ios_xr::Base::File < Specinfra::Command::Linux::Base::File
2
+ class << self
3
+ def check_is_accessible_by_user(file, user, access)
4
+ # Redhat-specific
5
+ "runuser -s /bin/sh -c \"test -#{access} #{file}\" #{user}"
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,2 @@
1
+ class Specinfra::Command::Ios_xr::Base::Host < Specinfra::Command::Base::Host
2
+ end
@@ -0,0 +1,2 @@
1
+ class Specinfra::Command::Ios_xr::Base::Iptables < Specinfra::Command::Linux::Base::Iptables
2
+ end
@@ -0,0 +1,30 @@
1
+ class Specinfra::Command::Ios_xr::Base::Package < Specinfra::Command::Linux::Base::Package
2
+ class << self
3
+ def check_is_installed(package, version=nil)
4
+ cmd = "rpm -q #{escape(package)}"
5
+ if version
6
+ cmd = "#{cmd} | grep -w -- #{escape(package)}-#{escape(version)}"
7
+ end
8
+ cmd
9
+ end
10
+
11
+ alias :check_is_installed_by_rpm :check_is_installed
12
+
13
+ def get_version(package, opts=nil)
14
+ "rpm -qi #{package} | grep Version | awk '{print $3}'"
15
+ end
16
+
17
+ def install(package, version=nil, option='')
18
+ if version
19
+ full_package = "#{package}-#{version}"
20
+ else
21
+ full_package = package
22
+ end
23
+ cmd = "yum -y #{option} install #{full_package}"
24
+ end
25
+
26
+ def remove(package, option='')
27
+ "yum -y #{option} remove #{package}"
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,5 @@
1
+ class Specinfra::Command::Ios_xr::Base::Port < Specinfra::Command::Base::Port
2
+ class << self
3
+ include Specinfra::Command::Module::Ss
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ class Specinfra::Command::Ios_xr::Base::Service < Specinfra::Command::Linux::Base::Service
2
+ end
@@ -0,0 +1,11 @@
1
+ class Specinfra::Command::Ios_xr::Base::Yumrepo < Specinfra::Command::Linux::Base::Yumrepo
2
+ class << self
3
+ def check_exists(repository)
4
+ "yum repolist all -C | grep ^#{escape(repository)}"
5
+ end
6
+
7
+ def check_is_enabled(repository)
8
+ "yum repolist enabled -C | grep -qs \"^[\\!\\*]\\?#{escape(repository)}\""
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ class Specinfra::Command::Ios_xr::V7 < Specinfra::Command::Redhat::Base
2
+ end
3
+
@@ -36,3 +36,4 @@ require 'specinfra/helper/detect_os/redhat'
36
36
  require 'specinfra/helper/detect_os/solaris'
37
37
  require 'specinfra/helper/detect_os/suse'
38
38
  require 'specinfra/helper/detect_os/nexus'
39
+ require 'specinfra/helper/detect_os/ios_xr'
@@ -0,0 +1,14 @@
1
+ class Specinfra::Helper::DetectOs::Ios_xr < Specinfra::Helper::DetectOs
2
+ def detect
3
+ # CentOS has a os-release file too, but this should do the right thing
4
+ if File.exists?('/etc/cisco-release')
5
+ contents = {}
6
+ File.read('/etc/cisco-release').split.collect {|x| x.split('=')}.each {|x| contents[x[0]] = x[1]}
7
+ # This test should only work on a nexus platform in the native OS
8
+ # It will fail in a guest/container shell, which should be picked up elsewhere
9
+ if contents['ID'] == "ios_xr" && contents['ID_LIKE'] && contents['ID_LIKE'].include?('wrlinux')
10
+ { :family => 'ios_xr', :release => contents['VERSION'] }
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.40.1"
2
+ VERSION = "2.41.0"
3
3
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "specinfra-cisco"
5
- spec.version = "2.40.2"
5
+ spec.version = "2.41.0"
6
6
  spec.authors = ["Gosuke Miyashita", "Carl Perry"]
7
7
  spec.email = ["gosukenator@gmail.com", "partnereng@chef.io"]
8
8
  spec.description = %q{Common layer for serverspec and itamae patched for Cisco platforms}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra-cisco
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.40.2
4
+ version: 2.41.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-28 00:00:00.000000000 Z
12
+ date: 2016-04-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-scp
@@ -269,6 +269,16 @@ files:
269
269
  - lib/specinfra/command/gentoo/base.rb
270
270
  - lib/specinfra/command/gentoo/base/package.rb
271
271
  - lib/specinfra/command/gentoo/base/service.rb
272
+ - lib/specinfra/command/ios_xr.rb
273
+ - lib/specinfra/command/ios_xr/base.rb
274
+ - lib/specinfra/command/ios_xr/base/file.rb
275
+ - lib/specinfra/command/ios_xr/base/host.rb
276
+ - lib/specinfra/command/ios_xr/base/iptables.rb
277
+ - lib/specinfra/command/ios_xr/base/package.rb
278
+ - lib/specinfra/command/ios_xr/base/port.rb
279
+ - lib/specinfra/command/ios_xr/base/service.rb
280
+ - lib/specinfra/command/ios_xr/base/yumrepo.rb
281
+ - lib/specinfra/command/ios_xr/v7.rb
272
282
  - lib/specinfra/command/linux.rb
273
283
  - lib/specinfra/command/linux/base.rb
274
284
  - lib/specinfra/command/linux/base/bond.rb
@@ -422,6 +432,7 @@ files:
422
432
  - lib/specinfra/helper/detect_os/esxi.rb
423
433
  - lib/specinfra/helper/detect_os/freebsd.rb
424
434
  - lib/specinfra/helper/detect_os/gentoo.rb
435
+ - lib/specinfra/helper/detect_os/ios_xr.rb
425
436
  - lib/specinfra/helper/detect_os/nexus.rb
426
437
  - lib/specinfra/helper/detect_os/nixos.rb
427
438
  - lib/specinfra/helper/detect_os/openbsd.rb
@@ -539,7 +550,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
539
550
  version: '0'
540
551
  requirements: []
541
552
  rubyforge_project:
542
- rubygems_version: 2.4.4
553
+ rubygems_version: 2.4.8
543
554
  signing_key:
544
555
  specification_version: 4
545
556
  summary: Common layer for serverspec and itamae patched for Cisco platforms