brocadesan 0.4.8 → 0.4.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/Rakefile +1 -1
- data/brocadesan.gemspec +2 -2
- data/lib/brocadesan/config/brocade/san/switch_cmd_mapping.yml +1 -1
- data/lib/brocadesan/config/parser_mapping.yml +1 -1
- data/lib/brocadesan/switch.rb +21 -10
- data/lib/meta_methods.rb +19 -1
- data/test/outputs/agshow_1.txt +6 -0
- data/test/outputs/apt_policy_1.txt +5 -0
- data/test/outputs/cfgtransshow_1.txt +4 -0
- data/test/outputs/chassisname_1.txt +5 -0
- data/test/outputs/dlsshow_1.txt +10 -1
- data/test/outputs/dlsshow_1.yml +1 -1
- data/test/outputs/dlsshow_2.txt +4 -0
- data/test/outputs/dlsshow_2.yml +1 -1
- data/test/outputs/fabricprincipal_1.txt +5 -0
- data/test/outputs/fabricshow_1.txt +6 -1
- data/test/outputs/fabricshow_1.yml +2 -1
- data/test/outputs/iodshow_1.txt +5 -0
- data/test/outputs/ipaddrshow_1.txt +4 -0
- data/test/outputs/ipaddrshow_2.txt +4 -0
- data/test/outputs/islshow_1.txt +5 -0
- data/test/outputs/islshow_2.txt +5 -0
- data/test/outputs/lscfg_show_1.txt +5 -0
- data/test/outputs/mapsdbshow_1.txt +5 -0
- data/test/outputs/ns_1.txt +5 -0
- data/test/outputs/ns_2.txt +6 -1
- data/test/outputs/switch_1.txt +5 -0
- data/test/outputs/switch_2.txt +5 -0
- data/test/outputs/switch_3.txt +5 -0
- data/test/outputs/trunkshow_1.txt +5 -0
- data/test/outputs/trunkshow_2.txt +5 -0
- data/test/outputs/version_1.txt +5 -0
- data/test/outputs/vf_switch_1.txt +5 -0
- data/test/switch_test.rb +5 -1
- metadata +11 -12
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MDM5MGY3YWUyOTQ1OGNkYTI3MjY1MmQ5ZDdmM2U1ZjY5YTkzYmY3MA==
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: aef8b620b4e0fbca42ee4c51b5f64ee264d7175a38c5fbf262bb66f9a9b12020
|
4
|
+
data.tar.gz: 90a702907e54d1971eab7b5318e048994da666023247df6f28e985b2c0e26a40
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
ODIzNDA5YjdkYjFiYzE3ZWU1YjhlYTNjZjIwZjEzODUxMGQ2YzVjMmJiYTQ2
|
11
|
-
ZjU4NTAzNjMyMjNhMjI5ZGRiMTNlYThjYTlhOTc5ODU3NTVhNWM=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
M2YwYTczYTRiZTBiZjVmNDhiOTNkMDM3NzZiZjliYzk5NjkwNzQzMDA4YTM2
|
14
|
-
YjIwNzE3MzM5NmIzYjVjMWIyMTBjYjNkNzY2NTM3NTkyYWRjN2VjODMwZDcw
|
15
|
-
OTBhZGExMWI2MzAzNGE2ZGNkNjEwYTBlNjc3OTY2YTNlMTUwYWU=
|
6
|
+
metadata.gz: 96141627e8c4aa91d1c0a3377a64c704b6bdb46daf666d2c892be3631b683bbaeb89b8fc053b52bc0c6eeb1b16b9351ba2996e3c6a8ae42a04b0576a4c6e7f29
|
7
|
+
data.tar.gz: f68424ce8550ad91dc54081c77ea15c67cf4271b57c4c8486f8995ee32a60a6f923c8625063e016de8451706f34a36d5241f7fced6276d5d19137d964eb2fc54
|
data/Rakefile
CHANGED
data/brocadesan.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'brocadesan'
|
3
|
-
s.version = '0.4.
|
4
|
-
s.date = '
|
3
|
+
s.version = '0.4.11'
|
4
|
+
s.date = '2023-03-06'
|
5
5
|
s.summary = "Brocade SAN library"
|
6
6
|
s.description = "Gem to manipulate FABOS based devices"
|
7
7
|
s.authors = ["Tomas Trnecka"]
|
data/lib/brocadesan/switch.rb
CHANGED
@@ -412,16 +412,18 @@ module SAN
|
|
412
412
|
|
413
413
|
|
414
414
|
# storing defined
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
415
|
+
if !@configuration[:defined_configuration][:cfg].nil?
|
416
|
+
@configuration[:defined_configuration][:cfg].each do |config,members|
|
417
|
+
|
418
|
+
effective = @configuration[:effective_configuration][:cfg].keys[0]==config ? true : false
|
419
|
+
|
420
|
+
cfg=ZoneConfiguration.new(config,:effective=>effective)
|
421
|
+
members.each do |member|
|
422
|
+
cfg.add_member member
|
423
|
+
end
|
424
|
+
|
425
|
+
tmp_cfg[:zone_configurations]<<cfg
|
422
426
|
end
|
423
|
-
|
424
|
-
tmp_cfg[:zone_configurations]<<cfg
|
425
427
|
end
|
426
428
|
|
427
429
|
if full
|
@@ -575,7 +577,7 @@ module SAN
|
|
575
577
|
|
576
578
|
def parse_line(line)
|
577
579
|
return if line.empty?
|
578
|
-
# we detect which command output we parse - commands start with defined prompt on the
|
580
|
+
# we detect which command output we parse - commands start with defined prompt on the CMD line
|
579
581
|
@parsed[:parsing_position] = case
|
580
582
|
# stripping fosexec, all pipes and ' to get pure command
|
581
583
|
when line.match(/^#{@prompt}/) then line.gsub(/(fosexec --fid \d+ -cmd \')|\'$|\' \|.*$/,"").split(" ")[1]
|
@@ -622,6 +624,9 @@ module SAN
|
|
622
624
|
|
623
625
|
# parser used to parse commands with 1 line output
|
624
626
|
def parse_oneline(line)
|
627
|
+
# do not process comment lines put there by fosexec
|
628
|
+
return if line.match(/"#{@parsed[:parsing_position]}"/)
|
629
|
+
return if line.match(/^-+$/)
|
625
630
|
@parsed[@parsed[:parsing_position].to_sym]=line
|
626
631
|
end
|
627
632
|
|
@@ -655,6 +660,8 @@ module SAN
|
|
655
660
|
@parsed[:cfg_transaction][:id] = $1
|
656
661
|
when line.match(/It is(.+)abortable$/) && @parsed[:parsing_position]=="cfgtransshow"
|
657
662
|
@parsed[:cfg_transaction][:abortable] = $1.match(/not/) ? false : true
|
663
|
+
# FOS 9 fosexec is adding some more output lines
|
664
|
+
when line.match("-----") || line.match(@parsed[:parsing_position])
|
658
665
|
else
|
659
666
|
#supportshow
|
660
667
|
@parsed[@parsed[:parsing_position].to_sym]||=""
|
@@ -737,6 +744,9 @@ module SAN
|
|
737
744
|
:qos => l[8..-1].include?("QOS"),
|
738
745
|
:cr_recov => l[8..-1].include?("CR_RECOV")
|
739
746
|
}
|
747
|
+
when line.match("DLS is") || line.match("E_Port Balance")
|
748
|
+
@parsed[@parsed[:parsing_position].to_sym]||=[]
|
749
|
+
@parsed[@parsed[:parsing_position].to_sym]<<line
|
740
750
|
#default handling if it doesno match specialized match
|
741
751
|
# parse lines formated like
|
742
752
|
# param: value
|
@@ -871,6 +881,7 @@ module SAN
|
|
871
881
|
# trunk parser
|
872
882
|
def parse_trunk(line)
|
873
883
|
return if line.match(/No trunking/i)
|
884
|
+
return if !line.match(/->/)
|
874
885
|
@parsed[:trunk_links]||=[]
|
875
886
|
l_tricky, l_simple = line.split("->")
|
876
887
|
l_t = l_tricky.split(":")
|
data/lib/meta_methods.rb
CHANGED
@@ -215,12 +215,30 @@ class Brocade::SAN::Switch
|
|
215
215
|
#
|
216
216
|
# Returns value in (string) format
|
217
217
|
|
218
|
+
##
|
219
|
+
# :method: maps_status
|
220
|
+
# :call-seq:
|
221
|
+
# maps_status(forced=true)
|
222
|
+
#
|
223
|
+
# If called with +true+ argument it will get the current_switch_policy_status from the switch instead of cache
|
224
|
+
#
|
225
|
+
# Returns value in (string) format
|
226
|
+
|
227
|
+
##
|
228
|
+
# :method: maps_status_details
|
229
|
+
# :call-seq:
|
230
|
+
# maps_status_details(forced=true)
|
231
|
+
#
|
232
|
+
# If called with +true+ argument it will get the maps_summary from the switch instead of cache
|
233
|
+
#
|
234
|
+
# Returns value in (string) format
|
235
|
+
|
218
236
|
##
|
219
237
|
# :method: ip
|
220
238
|
# :call-seq:
|
221
239
|
# ip(forced=true)
|
222
240
|
#
|
223
|
-
# If called with +true+ argument it will get the
|
241
|
+
# If called with +true+ argument it will get the ethernet_ip_address from the switch instead of cache
|
224
242
|
#
|
225
243
|
# Returns value in (string) format
|
226
244
|
|
data/test/outputs/agshow_1.txt
CHANGED
@@ -1,4 +1,10 @@
|
|
1
1
|
> agshow
|
2
|
+
|
3
|
+
---------------------------------------------------
|
4
|
+
|
5
|
+
"agshow" on FID 128:
|
6
|
+
|
7
|
+
|
2
8
|
Worldwide Name Ports Enet IP Addr Firmware Local/Remote Name
|
3
9
|
------------------------------------------------------------------------------------------------------
|
4
10
|
10:00:00:11:0a:00:84:a2 24 15.84.68.94 v6.1.0_uth8 remote VCFC2CN8314D00X
|
data/test/outputs/dlsshow_1.txt
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
> dlsshow
|
2
2
|
|
3
|
-
|
3
|
+
---------------------------------------------------
|
4
|
+
|
5
|
+
"dlsshow" on FID 128:
|
6
|
+
|
7
|
+
|
8
|
+
DLS is set with Lossless enabled, Two-hop Lossless disabled
|
9
|
+
|
10
|
+
|
11
|
+
E_Port Balance Priority is not set
|
12
|
+
|
4
13
|
|
data/test/outputs/dlsshow_1.yml
CHANGED
data/test/outputs/dlsshow_2.txt
CHANGED
data/test/outputs/dlsshow_2.yml
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
> fabricshow
|
2
|
+
|
3
|
+
---------------------------------------------------
|
4
|
+
|
5
|
+
"fabricshow" on FID 128:
|
6
|
+
|
2
7
|
Switch ID Worldwide Name Enet IP Addr FC IP Addr Name
|
3
8
|
-------------------------------------------------------------------------
|
4
9
|
1: fffc01 10:00:00:05:1e:4c:24:00 15.187.118.17 0.0.0.0 >"IDAA1C01"
|
@@ -7,4 +12,4 @@ Switch ID Worldwide Name Enet IP Addr FC IP Addr Name
|
|
7
12
|
132: fffc84 10:00:00:05:33:25:12:00 15.187.119.38 0.0.0.0 "GREA1C02"
|
8
13
|
|
9
14
|
The Fabric has 4 switches
|
10
|
-
|
15
|
+
Fabric Name: ENV2 VPC Lab - Fab B
|
data/test/outputs/iodshow_1.txt
CHANGED
data/test/outputs/islshow_1.txt
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
> islshow
|
2
|
+
|
3
|
+
---------------------------------------------------
|
4
|
+
|
5
|
+
"islshow" on FID 128:
|
6
|
+
|
2
7
|
1: 0-> 0 10:00:00:05:33:23:86:00 1 H2C04R065-U03-A sp: 8.000G bw: 64.000G TRUNK QOS
|
3
8
|
2: 8-> 17 10:00:00:05:33:c6:f7:23 29 H4C11R218-U02-I sp: 8.000G bw: 8.000G
|
4
9
|
17: 32-> 64 10:00:00:27:f8:34:f7:00 41 DXS-898-U03-A01 sp: 4.000G bw: 4.000G CR_RECOV
|
data/test/outputs/islshow_2.txt
CHANGED
data/test/outputs/ns_1.txt
CHANGED
data/test/outputs/ns_2.txt
CHANGED
data/test/outputs/switch_1.txt
CHANGED
data/test/outputs/switch_2.txt
CHANGED
data/test/outputs/switch_3.txt
CHANGED
data/test/outputs/version_1.txt
CHANGED
data/test/switch_test.rb
CHANGED
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brocadesan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Trnecka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.9'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.9'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '5.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '5.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake-notes
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.2'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.2'
|
55
55
|
description: Gem to manipulate FABOS based devices
|
@@ -157,17 +157,16 @@ require_paths:
|
|
157
157
|
- lib
|
158
158
|
required_ruby_version: !ruby/object:Gem::Requirement
|
159
159
|
requirements:
|
160
|
-
- -
|
160
|
+
- - ">="
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '0'
|
163
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
|
-
- -
|
165
|
+
- - ">="
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|
169
|
-
|
170
|
-
rubygems_version: 2.3.0
|
169
|
+
rubygems_version: 3.3.13
|
171
170
|
signing_key:
|
172
171
|
specification_version: 4
|
173
172
|
summary: Brocade SAN library
|