network-utility 1.1.25 → 1.1.26

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
  SHA256:
3
- metadata.gz: fdc046e6fdea245860b42ef6945bd3e5375c43f9a4743f4dd2e26ce0b99dafca
4
- data.tar.gz: '028d40b8be3139b6383e8fa1778eb13895d5fe4a6b6234c6aa4cbed1097bee0e'
3
+ metadata.gz: dddb5ef87fcf77347bd4fe83824094aac1176a46f262665fd9e28e8aa97627c8
4
+ data.tar.gz: 8864d580b9816f9cbbd67bcd02e02164ae0e19ebcb92159a76b79c673a3c2b85
5
5
  SHA512:
6
- metadata.gz: 5ceba13e446b7fdda4cd54ee061fe71c310471cb8c154dc430be5c024037d3ba0c25d0a4741f54eda72ccab9d9ed6b8bde5f2b6afaa0e7d18d2938929675a56b
7
- data.tar.gz: b73c274a709c2535dd1d45d7801384a7ff4c644dea6d63f42c39b9bc3bf351cb29e9fde7847dc7b386d1aac90f57c34d68b6f56cddb8896a89abeab8ddeb2290
6
+ metadata.gz: 7b481dba22b7ca7218fcb210d71200983dae8513fa3b01c043b1477df01ac19f76f38ba894e712ab219c8a89dc5d418d1ef1ac900c234494677f6c0f7d5dda50
7
+ data.tar.gz: 8cef0b797c129f6d0d0db83fc657438e5a30ec516d870586f9773234a0c4c0ad778cd8dde95c2fed0b2956e577fd54324e7022b30039dea578f488f7436d47fb
@@ -67,7 +67,7 @@ module CX600_X16A
67
67
  # func: 根据一个端口的描述信息,给出其格式化的类型、连接符、端口编号
68
68
  def 端口识别 描述
69
69
  连接符 = ''
70
- type = /GE|50\|100GE|50GE|100GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Global\-VE|FlexE\-100G|FlexE\-50\|100G|FlexE|Vlanif|Virtual\-Template|NULL|LoopBack|Aux/.match(描述)
70
+ type = /GE|50\|100GE|50GE|100GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Global\-VE|FlexE\-100G|FlexE\-50\|100G|FlexE|Vlanif|Virtual\-Template|NULL|LoopBack|Logic\-Channel|Aux/.match(描述)
71
71
  类型 = type ? type.to_s : '未知类型'
72
72
  port = /(\d+|\/|\.)*(\d+)/.match(描述.split(类型).join)
73
73
  端口 = port ? port.to_s : '未知端口'
@@ -241,6 +241,13 @@ module CX600_X16A
241
241
  return nil
242
242
  end
243
243
 
244
+ # func: 给出聚合接口查询命令的返回结果,提取接口对应的物理接口,若无返回空
245
+ def 聚合接口查询 查询报文
246
+ return [] if 查询报文.include?("not exist")
247
+ parts = 查询报文.split("--------------------------------------------------------------------------------")
248
+ return parts[1].split("\n").map{|s|s.split(" ")}.select{|s|s.size>7}.map{|s|s.first.split('(').first}.select{|s|!s.include?('Actor')}
249
+ end
250
+
244
251
  #####################################################################################################
245
252
  # 接口VLAN相关
246
253
  # 对接口vlan配置的解析
@@ -307,6 +314,7 @@ module CX600_X16A
307
314
 
308
315
  子接口名称 = self.端口识别(接口配置)
309
316
  bas子接口数据库[name] ||= {}
317
+ 子接口索引 = []
310
318
  if 子接口名称[0].include?("GigabitEthernet") or 子接口名称[0].include?("50GE") or 子接口名称[0].include?("50|100GE") or 子接口名称[0].include?("100GE")
311
319
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
312
320
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
@@ -67,7 +67,7 @@ module CX600_X8A
67
67
  # func: 根据一个端口的描述信息,给出其格式化的类型、连接符、端口编号
68
68
  def 端口识别 描述
69
69
  连接符 = ''
70
- type = /GE|50\|100GE|50GE|100GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Global\-VE|FlexE\-100G|FlexE\-50\|100G|FlexE|Vlanif|Virtual\-Template|NULL|LoopBack|Aux/.match(描述)
70
+ type = /GE|50\|100GE|50GE|100GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Global\-VE|FlexE\-100G|FlexE\-50\|100G|FlexE|Vlanif|Virtual\-Template|NULL|LoopBack|Logic\-Channel|Aux/.match(描述)
71
71
  类型 = type ? type.to_s : '未知类型'
72
72
  port = /(\d+|\/|\.)*(\d+)/.match(描述.split(类型).join)
73
73
  端口 = port ? port.to_s : '未知端口'
@@ -241,6 +241,13 @@ module CX600_X8A
241
241
  return nil
242
242
  end
243
243
 
244
+ # func: 给出聚合接口查询命令的返回结果,提取接口对应的物理接口,若无返回空
245
+ def 聚合接口查询 查询报文
246
+ return [] if 查询报文.include?("not exist")
247
+ parts = 查询报文.split("--------------------------------------------------------------------------------")
248
+ return parts[1].split("\n").map{|s|s.split(" ")}.select{|s|s.size>7}.map{|s|s.first.split('(').first}.select{|s|!s.include?('Actor')}
249
+ end
250
+
244
251
  #####################################################################################################
245
252
  # 接口VLAN相关
246
253
  # 对接口vlan配置的解析
@@ -307,6 +314,7 @@ module CX600_X8A
307
314
 
308
315
  子接口名称 = self.端口识别(接口配置)
309
316
  bas子接口数据库[name] ||= {}
317
+ 子接口索引 = []
310
318
  if 子接口名称[0].include?("GigabitEthernet") or 子接口名称[0].include?("50GE") or 子接口名称[0].include?("50|100GE") or 子接口名称[0].include?("100GE")
311
319
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
312
320
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
@@ -315,6 +315,7 @@ module MA5200G_8
315
315
 
316
316
  子接口名称 = self.端口识别(接口配置)
317
317
  bas子接口数据库[name] ||= {}
318
+ 子接口索引 = []
318
319
  if 子接口名称[0].include?("GigabitEthernet")
319
320
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
320
321
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
@@ -315,6 +315,7 @@ module ME60_16
315
315
 
316
316
  子接口名称 = self.端口识别(接口配置)
317
317
  bas子接口数据库[name] ||= {}
318
+ 子接口索引 = []
318
319
  if 子接口名称[0].include?("GigabitEthernet")
319
320
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
320
321
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
@@ -336,7 +337,7 @@ module ME60_16
336
337
  bas子接口数据库[name][索引][pv] += cv
337
338
  bas子接口数据库[name][索引][pv].uniq!
338
339
  end
339
- end if 子接口索引
340
+ end
340
341
  end
341
342
  return bas子接口数据库
342
343
  end
@@ -315,6 +315,7 @@ module ME60_X16
315
315
 
316
316
  子接口名称 = self.端口识别(接口配置)
317
317
  bas子接口数据库[name] ||= {}
318
+ 子接口索引 = []
318
319
  if 子接口名称[0].include?("GigabitEthernet")
319
320
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
320
321
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
@@ -336,7 +337,7 @@ module ME60_X16
336
337
  bas子接口数据库[name][索引][pv] += cv
337
338
  bas子接口数据库[name][索引][pv].uniq!
338
339
  end
339
- end if 子接口索引
340
+ end
340
341
  end
341
342
  return bas子接口数据库
342
343
  end
@@ -315,7 +315,8 @@ module NE40E_X16
315
315
 
316
316
  子接口名称 = self.端口识别(接口配置)
317
317
  bas子接口数据库[name] ||= {}
318
- if 子接口名称[0].include?("GigabitEthernet")
318
+ 子接口索引 = []
319
+ if 子接口名称[0].include?("GigabitEthernet") or 子接口名称[0].include?("50GE") or 子接口名称[0].include?("50|100GE") or 子接口名称[0].include?("100GE")
319
320
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
320
321
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
321
322
  end
@@ -315,7 +315,8 @@ module NE40E_X16A
315
315
 
316
316
  子接口名称 = self.端口识别(接口配置)
317
317
  bas子接口数据库[name] ||= {}
318
- if 子接口名称[0].include?("GigabitEthernet")
318
+ 子接口索引 = []
319
+ if 子接口名称[0].include?("GigabitEthernet") or 子接口名称[0].include?("50GE") or 子接口名称[0].include?("50|100GE") or 子接口名称[0].include?("100GE")
319
320
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
320
321
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
321
322
  end
@@ -315,6 +315,7 @@ module NE40E_X8
315
315
 
316
316
  子接口名称 = self.端口识别(接口配置)
317
317
  bas子接口数据库[name] ||= {}
318
+ 子接口索引 = []
318
319
  if 子接口名称[0].include?("GigabitEthernet")
319
320
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
320
321
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
data/document/if-NE40E.md CHANGED
@@ -68,7 +68,7 @@ module NE40E
68
68
  # func: 根据一个端口的描述信息,给出其格式化的类型、连接符、端口编号
69
69
  def 端口识别 描述
70
70
  连接符 = ''
71
- type = /GE|50\|100GE|50GE|100GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Global\-VE|FlexE\-100G|FlexE\-50\|100G|FlexE|Vlanif|Virtual\-Template|NULL|LoopBack|Aux/.match(描述)
71
+ type = /GE|50\|100GE|50GE|100GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Global\-VE|FlexE\-100G|FlexE\-50\|100G|FlexE|Vlanif|Virtual\-Template|NULL|LoopBack|Logic\-Channel|Aux/.match(描述)
72
72
  类型 = type ? type.to_s : '未知类型'
73
73
  port = /(\d+|\/|\.)*(\d+)/.match(描述.split(类型).join)
74
74
  端口 = port ? port.to_s : '未知端口'
@@ -315,6 +315,7 @@ module NE40E
315
315
 
316
316
  子接口名称 = self.端口识别(接口配置)
317
317
  bas子接口数据库[name] ||= {}
318
+ 子接口索引 = []
318
319
  if 子接口名称[0].include?("GigabitEthernet") or 子接口名称[0].include?("50GE") or 子接口名称[0].include?("50|100GE") or 子接口名称[0].include?("100GE")
319
320
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
320
321
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
@@ -39,7 +39,7 @@ module NE5000E_20
39
39
 
40
40
  def 特殊接口配置 接口集合
41
41
  接口集合.collect{|接口|
42
- 接口 if /Virtual|Aux|NULL|LoopBack|Logic\-Channel/.match(接口.split("\n")[0])
42
+ 接口 if /Virtual\-Ethernet|Virtual|Aux|NULL|LoopBack|Logic\-Channel/.match(接口.split("\n")[0])
43
43
  }.compact.sort_by{|接口|接口.split("\n")[0]}
44
44
  end
45
45
 
@@ -68,7 +68,7 @@ module NE5000E_20
68
68
  # func: 根据一个端口的描述信息,给出其格式化的类型、连接符、端口编号
69
69
  def 端口识别 描述
70
70
  连接符 = ''
71
- type = /100GE|GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Virtual\-Template|NULL|LoopBack|Aux/.match(描述)
71
+ type = /GE|50\|100GE|50GE|100GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Global\-VE|FlexE\-100G|FlexE\-50\|100G|FlexE|Vlanif|Virtual\-Template|NULL|LoopBack|Logic\-Channel|Aux/.match(描述)
72
72
  类型 = type ? type.to_s : '未知类型'
73
73
  port = /(\d+|\/|\.)*(\d+)/.match(描述.split(类型).join)
74
74
  端口 = port ? port.to_s : '未知端口'
@@ -315,7 +315,8 @@ module NE5000E_20
315
315
 
316
316
  子接口名称 = self.端口识别(接口配置)
317
317
  bas子接口数据库[name] ||= {}
318
- if 子接口名称[0].include?("GigabitEthernet")
318
+ 子接口索引 = []
319
+ if 子接口名称[0].include?("GigabitEthernet") or 子接口名称[0].include?("50GE") or 子接口名称[0].include?("50|100GE") or 子接口名称[0].include?("100GE")
319
320
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
320
321
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
321
322
  end
@@ -349,7 +350,7 @@ module NE5000E_20
349
350
  # 针对display interface brief main
350
351
  def 统计接口 文本
351
352
  文本.split("\n").inject([]) do|表格, 行|
352
- 表格 << 行.split(" ") if 行.include?("100GE") or 行.include?("GigabitEthernet") or 行.include?("Eth-Trunk")
353
+ 表格 << 行.split(" ") if 行.include?("GigabitEthernet") or 行.include?("50GE") or 行.include?("50|100GE") or 行.include?("100GE") or 行.include?("Eth-Trunk")
353
354
  表格 # [interface, physical, protocol, in-uti, out-uti, in-errors, out-errors]
354
355
  end
355
356
  end
@@ -39,7 +39,7 @@ module NE5000E_X16
39
39
 
40
40
  def 特殊接口配置 接口集合
41
41
  接口集合.collect{|接口|
42
- 接口 if /Virtual|Aux|NULL|LoopBack|Logic\-Channel/.match(接口.split("\n")[0])
42
+ 接口 if /Virtual\-Ethernet|Virtual|Aux|NULL|LoopBack|Logic\-Channel/.match(接口.split("\n")[0])
43
43
  }.compact.sort_by{|接口|接口.split("\n")[0]}
44
44
  end
45
45
 
@@ -68,7 +68,7 @@ module NE5000E_X16
68
68
  # func: 根据一个端口的描述信息,给出其格式化的类型、连接符、端口编号
69
69
  def 端口识别 描述
70
70
  连接符 = ''
71
- type = /100GE|GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Virtual\-Template|NULL|LoopBack|Aux/.match(描述)
71
+ type = /GE|50\|100GE|50GE|100GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Global\-VE|FlexE\-100G|FlexE\-50\|100G|FlexE|Vlanif|Virtual\-Template|NULL|LoopBack|Logic\-Channel|Aux/.match(描述)
72
72
  类型 = type ? type.to_s : '未知类型'
73
73
  port = /(\d+|\/|\.)*(\d+)/.match(描述.split(类型).join)
74
74
  端口 = port ? port.to_s : '未知端口'
@@ -205,7 +205,7 @@ module NE5000E_X16
205
205
  return {'access-type'=>atype, a3dom => dname}
206
206
  else
207
207
  return {'access-type'=>atype}
208
- end
208
+ end
209
209
  end
210
210
  end
211
211
  return {}
@@ -315,7 +315,8 @@ module NE5000E_X16
315
315
 
316
316
  子接口名称 = self.端口识别(接口配置)
317
317
  bas子接口数据库[name] ||= {}
318
- if 子接口名称[0].include?("GigabitEthernet")
318
+ 子接口索引 = []
319
+ if 子接口名称[0].include?("GigabitEthernet") or 子接口名称[0].include?("50GE") or 子接口名称[0].include?("50|100GE") or 子接口名称[0].include?("100GE")
319
320
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
320
321
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
321
322
  end
@@ -349,7 +350,7 @@ module NE5000E_X16
349
350
  # 针对display interface brief main
350
351
  def 统计接口 文本
351
352
  文本.split("\n").inject([]) do|表格, 行|
352
- 表格 << 行.split(" ") if 行.include?("100GE") or 行.include?("GigabitEthernet") or 行.include?("Eth-Trunk")
353
+ 表格 << 行.split(" ") if 行.include?("GigabitEthernet") or 行.include?("50GE") or 行.include?("50|100GE") or 行.include?("100GE") or 行.include?("Eth-Trunk")
353
354
  表格 # [interface, physical, protocol, in-uti, out-uti, in-errors, out-errors]
354
355
  end
355
356
  end
@@ -39,7 +39,7 @@ module NE5000E_X16A
39
39
 
40
40
  def 特殊接口配置 接口集合
41
41
  接口集合.collect{|接口|
42
- 接口 if /Virtual|Aux|NULL|LoopBack|Logic\-Channel/.match(接口.split("\n")[0])
42
+ 接口 if /Virtual\-Ethernet|Virtual|Aux|NULL|LoopBack|Logic\-Channel/.match(接口.split("\n")[0])
43
43
  }.compact.sort_by{|接口|接口.split("\n")[0]}
44
44
  end
45
45
 
@@ -68,7 +68,7 @@ module NE5000E_X16A
68
68
  # func: 根据一个端口的描述信息,给出其格式化的类型、连接符、端口编号
69
69
  def 端口识别 描述
70
70
  连接符 = ''
71
- type = /100GE|GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Virtual\-Template|NULL|LoopBack|Aux/.match(描述)
71
+ type = /GE|50\|100GE|50GE|100GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Global\-VE|FlexE\-100G|FlexE\-50\|100G|FlexE|Vlanif|Virtual\-Template|NULL|LoopBack|Logic\-Channel|Aux/.match(描述)
72
72
  类型 = type ? type.to_s : '未知类型'
73
73
  port = /(\d+|\/|\.)*(\d+)/.match(描述.split(类型).join)
74
74
  端口 = port ? port.to_s : '未知端口'
@@ -205,7 +205,7 @@ module NE5000E_X16A
205
205
  return {'access-type'=>atype, a3dom => dname}
206
206
  else
207
207
  return {'access-type'=>atype}
208
- end
208
+ end
209
209
  end
210
210
  end
211
211
  return {}
@@ -315,7 +315,8 @@ module NE5000E_X16A
315
315
 
316
316
  子接口名称 = self.端口识别(接口配置)
317
317
  bas子接口数据库[name] ||= {}
318
- if 子接口名称[0].include?("GigabitEthernet")
318
+ 子接口索引 = []
319
+ if 子接口名称[0].include?("GigabitEthernet") or 子接口名称[0].include?("50GE") or 子接口名称[0].include?("50|100GE") or 子接口名称[0].include?("100GE")
319
320
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
320
321
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
321
322
  end
@@ -349,7 +350,7 @@ module NE5000E_X16A
349
350
  # 针对display interface brief main
350
351
  def 统计接口 文本
351
352
  文本.split("\n").inject([]) do|表格, 行|
352
- 表格 << 行.split(" ") if 行.include?("100GE") or 行.include?("GigabitEthernet") or 行.include?("Eth-Trunk")
353
+ 表格 << 行.split(" ") if 行.include?("GigabitEthernet") or 行.include?("50GE") or 行.include?("50|100GE") or 行.include?("100GE") or 行.include?("Eth-Trunk")
353
354
  表格 # [interface, physical, protocol, in-uti, out-uti, in-errors, out-errors]
354
355
  end
355
356
  end
@@ -68,7 +68,7 @@ module NE8000E_X8
68
68
  # func: 根据一个端口的描述信息,给出其格式化的类型、连接符、端口编号
69
69
  def 端口识别 描述
70
70
  连接符 = ''
71
- type = /GE|50\|100GE|50GE|100GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Global\-VE|FlexE\-100G|FlexE\-50\|100G|FlexE|Vlanif|Virtual\-Template|NULL|LoopBack|Aux/.match(描述)
71
+ type = /GE|50\|100GE|50GE|100GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Global\-VE|FlexE\-100G|FlexE\-50\|100G|FlexE|Vlanif|Virtual\-Template|NULL|LoopBack|Logic\-Channel|Aux/.match(描述)
72
72
  类型 = type ? type.to_s : '未知类型'
73
73
  port = /(\d+|\/|\.)*(\d+)/.match(描述.split(类型).join)
74
74
  端口 = port ? port.to_s : '未知端口'
@@ -315,6 +315,7 @@ module NE8000E_X8
315
315
 
316
316
  子接口名称 = self.端口识别(接口配置)
317
317
  bas子接口数据库[name] ||= {}
318
+ 子接口索引 = []
318
319
  if 子接口名称[0].include?("GigabitEthernet") or 子接口名称[0].include?("50GE") or 子接口名称[0].include?("50|100GE") or 子接口名称[0].include?("100GE")
319
320
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
320
321
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
data/document/if-NE80E.md CHANGED
@@ -315,6 +315,7 @@ module NE80E
315
315
 
316
316
  子接口名称 = self.端口识别(接口配置)
317
317
  bas子接口数据库[name] ||= {}
318
+ 子接口索引 = []
318
319
  if 子接口名称[0].include?("GigabitEthernet") or 子接口名称[0].include?("50GE") or 子接口名称[0].include?("50|100GE") or 子接口名称[0].include?("100GE")
319
320
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
320
321
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
@@ -68,7 +68,7 @@ module NE8100_X8
68
68
  # func: 根据一个端口的描述信息,给出其格式化的类型、连接符、端口编号
69
69
  def 端口识别 描述
70
70
  连接符 = ''
71
- type = /GE|50\|100GE|50GE|100GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Global\-VE|FlexE\-100G|FlexE\-50\|100G|FlexE|Vlanif|Virtual\-Template|NULL|LoopBack|Aux/.match(描述)
71
+ type = /GE|50\|100GE|50GE|100GE|GigabitEthernet|Pos|Ethernet|Eth\-Trunk|Global\-VE|FlexE\-100G|FlexE\-50\|100G|FlexE|Vlanif|Virtual\-Template|NULL|LoopBack|Logic\-Channel|Aux/.match(描述)
72
72
  类型 = type ? type.to_s : '未知类型'
73
73
  port = /(\d+|\/|\.)*(\d+)/.match(描述.split(类型).join)
74
74
  端口 = port ? port.to_s : '未知端口'
@@ -315,6 +315,7 @@ module NE8100_X8
315
315
 
316
316
  子接口名称 = self.端口识别(接口配置)
317
317
  bas子接口数据库[name] ||= {}
318
+ 子接口索引 = []
318
319
  if 子接口名称[0].include?("GigabitEthernet") or 子接口名称[0].include?("50GE") or 子接口名称[0].include?("50|100GE") or 子接口名称[0].include?("100GE")
319
320
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
320
321
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
@@ -315,6 +315,7 @@ module VNE9000
315
315
 
316
316
  子接口名称 = self.端口识别(接口配置)
317
317
  bas子接口数据库[name] ||= {}
318
+ 子接口索引 = []
318
319
  if 子接口名称[0].include?("GigabitEthernet") or 子接口名称[0].include?("50GE") or 子接口名称[0].include?("50|100GE") or 子接口名称[0].include?("100GE")
319
320
  # 子接口索引 = ["eth--"+子接口名称[-1].split(".")[0].split('/')[-3..-1].join(',')] # AIBOS风格
320
321
  子接口索引 = [子接口名称.join.split(".")[0]] # 原生风格
data/network.rb CHANGED
@@ -22,5 +22,5 @@
22
22
  ].each{|mod|require mod}
23
23
 
24
24
  module Network
25
- VERSION = '1.1.25'
25
+ VERSION = '1.1.26'
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: network-utility
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.25
4
+ version: 1.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt