Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reference-repository
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
grid5000
reference-repository
Commits
d449c731
Commit
d449c731
authored
4 years ago
by
Simon Delamare
Browse files
Options
Downloads
Patches
Plain Diff
[lib] Avoid reference-api to crash if snmp_pattern is missing from a net. equipment
parent
5c51c2c1
No related branches found
No related tags found
No related merge requests found
Pipeline
#185114
passed
4 years ago
Stage: validate
Stage: generate
Stage: deploy
Stage: .post
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/refrepo/gen/reference-api.rb
+1
-1
1 addition, 1 deletion
lib/refrepo/gen/reference-api.rb
with
1 addition
and
1 deletion
lib/refrepo/gen/reference-api.rb
+
1
−
1
View file @
d449c731
...
@@ -24,7 +24,7 @@ def net_switch_port_lookup(site, node_uid, interface='')
...
@@ -24,7 +24,7 @@ def net_switch_port_lookup(site, node_uid, interface='')
if
switch_remote_uid
==
node_uid
and
switch_remote_port
==
interface
if
switch_remote_uid
==
node_uid
and
switch_remote_port
==
interface
# Build port name from snmp_naming_pattern
# Build port name from snmp_naming_pattern
# Example: '3 2 GigabitEthernet%LINECARD%/%PORT%' -> 'GigabitEthernet3/2'
# Example: '3 2 GigabitEthernet%LINECARD%/%PORT%' -> 'GigabitEthernet3/2'
pattern
=
port
[
"snmp_pattern"
]
||
lc
[
"snmp_pattern"
]
pattern
=
port
[
"snmp_pattern"
]
||
lc
[
"snmp_pattern"
]
||
""
port_name
=
pattern
.
sub
(
"%LINECARD%"
,
lc_uid
.
to_s
).
sub
(
"%PORT%"
,
port_uid
.
to_s
)
port_name
=
pattern
.
sub
(
"%LINECARD%"
,
lc_uid
.
to_s
).
sub
(
"%PORT%"
,
port_uid
.
to_s
)
return
switch_uid
,
port_name
return
switch_uid
,
port_name
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment