specinfra 2.60.4 → 2.61.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 +4 -4
- data/lib/specinfra/command/eos/base.rb +2 -0
- data/lib/specinfra/command/eos.rb +1 -0
- data/lib/specinfra/command.rb +4 -0
- data/lib/specinfra/helper/detect_os/eos.rb +12 -0
- data/lib/specinfra/helper/detect_os.rb +1 -0
- data/lib/specinfra/version.rb +1 -1
- data/spec/helper/detect_os/eos_spec.rb +31 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2ea24132ec1c579203ed59dc298d1ba67d66a79
|
4
|
+
data.tar.gz: b64796bfe4bff00325714d7c8c401e5ba96dae62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48fe665519257ca2741a27098361f5dc6c1e9844a6af51011c5bba7aa1d1a57eddd36c593cb91d1387796518440886e3993d64e17958c4fe031f09d1d324e702
|
7
|
+
data.tar.gz: 9a8a0e55a502274c07eaf215f857198ceeeb01425a3d7954b95cf4792be3c6894f42ffed252c6d8ff642e48c0eae018e0c3467893641e2ba58f34d9de6dcee03
|
@@ -0,0 +1 @@
|
|
1
|
+
class Specinfra::Command::Eos; end
|
data/lib/specinfra/command.rb
CHANGED
@@ -104,6 +104,10 @@ require 'specinfra/command/fedora/base/service'
|
|
104
104
|
require 'specinfra/command/fedora/v15'
|
105
105
|
require 'specinfra/command/fedora/v15/service'
|
106
106
|
|
107
|
+
# Arista EOS (inherit Fedora)
|
108
|
+
require 'specinfra/command/eos'
|
109
|
+
require 'specinfra/command/eos/base'
|
110
|
+
|
107
111
|
# Amazon Linux (inherit RedHat)
|
108
112
|
require 'specinfra/command/amazon'
|
109
113
|
require 'specinfra/command/amazon/base'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class Specinfra::Helper::DetectOs::Eos < Specinfra::Helper::DetectOs
|
2
|
+
def detect
|
3
|
+
# Arista Networks EOS
|
4
|
+
if run_command('ls /etc/Eos-release').success?
|
5
|
+
line = run_command('cat /etc/Eos-release').stdout
|
6
|
+
if line =~ /EOS (\d[\d.]*[A-Z]*)/
|
7
|
+
release = $1
|
8
|
+
end
|
9
|
+
{ :family => 'arista_eos', :release => release }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -27,6 +27,7 @@ require 'specinfra/helper/detect_os/coreos'
|
|
27
27
|
require 'specinfra/helper/detect_os/darwin'
|
28
28
|
require 'specinfra/helper/detect_os/debian'
|
29
29
|
require 'specinfra/helper/detect_os/esxi'
|
30
|
+
require 'specinfra/helper/detect_os/eos'
|
30
31
|
require 'specinfra/helper/detect_os/freebsd'
|
31
32
|
require 'specinfra/helper/detect_os/gentoo'
|
32
33
|
require 'specinfra/helper/detect_os/nixos'
|
data/lib/specinfra/version.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'specinfra/helper/detect_os/eos'
|
3
|
+
|
4
|
+
describe Specinfra::Helper::DetectOs::Eos do
|
5
|
+
eos = Specinfra::Helper::DetectOs::Eos.new(:exec)
|
6
|
+
it 'Should return eos family and the correct version.' do
|
7
|
+
allow(eos).to receive(:run_command).with('ls /etc/Eos-release') {
|
8
|
+
CommandResult.new(:stdout => '/etc/Eos-release', :exit_status => 0)
|
9
|
+
}
|
10
|
+
allow(eos).to receive(:run_command).with('cat /etc/Eos-release') {
|
11
|
+
CommandResult.new(:stdout => 'Arista Networks EOS 4.15.3F', :exit_status => 0)
|
12
|
+
}
|
13
|
+
expect(eos.detect).to include(
|
14
|
+
:family => 'arista_eos',
|
15
|
+
:release => '4.15.3F'
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'Should return eos nil when a non-conforming EOS version is installed.' do
|
20
|
+
allow(eos).to receive(:run_command).with('ls /etc/Eos-release') {
|
21
|
+
CommandResult.new(:stdout => '/etc/Eos-release', :exit_status => 0)
|
22
|
+
}
|
23
|
+
allow(eos).to receive(:run_command).with('cat /etc/Eos-release') {
|
24
|
+
CommandResult.new(:stdout => 'Arista Networks EOS foo', :exit_status => 0)
|
25
|
+
}
|
26
|
+
expect(eos.detect).to include(
|
27
|
+
:family => 'arista_eos',
|
28
|
+
:release => nil
|
29
|
+
)
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specinfra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.61.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-scp
|
@@ -279,6 +279,8 @@ files:
|
|
279
279
|
- lib/specinfra/command/debian/v8.rb
|
280
280
|
- lib/specinfra/command/debian/v8/port.rb
|
281
281
|
- lib/specinfra/command/debian/v8/service.rb
|
282
|
+
- lib/specinfra/command/eos.rb
|
283
|
+
- lib/specinfra/command/eos/base.rb
|
282
284
|
- lib/specinfra/command/esxi.rb
|
283
285
|
- lib/specinfra/command/esxi/base.rb
|
284
286
|
- lib/specinfra/command/esxi/base/package.rb
|
@@ -463,6 +465,7 @@ files:
|
|
463
465
|
- lib/specinfra/helper/detect_os/coreos.rb
|
464
466
|
- lib/specinfra/helper/detect_os/darwin.rb
|
465
467
|
- lib/specinfra/helper/detect_os/debian.rb
|
468
|
+
- lib/specinfra/helper/detect_os/eos.rb
|
466
469
|
- lib/specinfra/helper/detect_os/esxi.rb
|
467
470
|
- lib/specinfra/helper/detect_os/freebsd.rb
|
468
471
|
- lib/specinfra/helper/detect_os/gentoo.rb
|
@@ -566,6 +569,7 @@ files:
|
|
566
569
|
- spec/configuration_spec.rb
|
567
570
|
- spec/helper/detect_os/aix_spec.rb
|
568
571
|
- spec/helper/detect_os/darwin_spec.rb
|
572
|
+
- spec/helper/detect_os/eos_spec.rb
|
569
573
|
- spec/helper/detect_os/esxi_spec.rb
|
570
574
|
- spec/helper/detect_os/freebsd_spec.rb
|
571
575
|
- spec/helper/detect_os/openbsd_spec.rb
|
@@ -682,6 +686,7 @@ test_files:
|
|
682
686
|
- spec/configuration_spec.rb
|
683
687
|
- spec/helper/detect_os/aix_spec.rb
|
684
688
|
- spec/helper/detect_os/darwin_spec.rb
|
689
|
+
- spec/helper/detect_os/eos_spec.rb
|
685
690
|
- spec/helper/detect_os/esxi_spec.rb
|
686
691
|
- spec/helper/detect_os/freebsd_spec.rb
|
687
692
|
- spec/helper/detect_os/openbsd_spec.rb
|