Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
noc
noc
Commits
50b94f12
Verified
Commit
50b94f12
authored
Apr 23, 2022
by
Andrey Vertiprahov
Browse files
Fix typo.
parent
6e7ce0f8
Pipeline
#35969
passed with stages
in 17 minutes and 17 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
inv/models/discoveryid.py
View file @
50b94f12
...
...
@@ -49,12 +49,12 @@ class DiscoveryID(Document):
"collection"
:
"noc.inv.discovery_id"
,
"strict"
:
False
,
"auto_create_index"
:
False
,
"indexes"
:
[
"object"
,
"hostname"
,
"udld_id"
,
"macs"
],
"indexes"
:
[
"object"
,
"hostname"
,
"hostname_id"
,
"udld_id"
,
"macs"
],
}
object
=
ForeignKeyField
(
ManagedObject
)
chassis_mac
=
ListField
(
EmbeddedDocumentField
(
MACRange
))
hostname
=
StringField
()
hostname_
raw
=
StringField
()
hostname_
id
=
StringField
()
router_id
=
StringField
()
udld_id
=
StringField
()
# UDLD local identifier
#
...
...
@@ -115,8 +115,8 @@ class DiscoveryID(Document):
if
o
:
old_macs
=
set
(
m
.
first_mac
for
m
in
o
.
chassis_mac
)
o
.
chassis_mac
=
ranges
o
.
hostname
=
hostname
.
lower
()
o
.
hostname_
raw
=
hostname
o
.
hostname
=
hostname
o
.
hostname_
id
=
hostname
.
lower
()
o
.
router_id
=
router_id
old_macs
-=
set
(
m
.
first_mac
for
m
in
o
.
chassis_mac
)
if
old_macs
:
...
...
@@ -128,8 +128,8 @@ class DiscoveryID(Document):
cls
(
object
=
object
,
chassis_mac
=
ranges
,
hostname
=
hostname
.
lower
()
,
hostname_
raw
=
hostname
,
hostname
=
hostname
,
hostname_
id
=
hostname
.
lower
()
,
router_id
=
router_id
,
macs
=
macs
,
).
save
()
...
...
services/discovery/jobs/base.py
View file @
50b94f12
...
...
@@ -1003,7 +1003,7 @@ class TopologyDiscoveryCheck(DiscoveryCheck):
"""
hostname
=
hostname
.
lower
()
if
hostname
not
in
self
.
neighbor_hostname_cache
:
hosts
=
DiscoveryID
.
objects
.
filter
(
hostname
=
hostname
)[:
2
]
hosts
=
DiscoveryID
.
objects
.
filter
(
hostname
_id
=
hostname
)[:
2
]
n
=
None
if
len
(
hosts
)
==
1
:
n
=
hosts
[
0
].
object
...
...
@@ -1012,7 +1012,7 @@ class TopologyDiscoveryCheck(DiscoveryCheck):
# Try to resolve anyway
m
=
list
(
DiscoveryID
.
objects
.
filter
(
hostname__istartswith
=
hostname
+
"."
if
"."
not
in
hostname
else
hostname
hostname_
id_
_istartswith
=
hostname
+
"."
if
"."
not
in
hostname
else
hostname
)
)
if
len
(
m
)
==
1
:
...
...
Dmitry Volodin
@dv
mentioned in commit
2adb3832
·
Jun 25, 2022
mentioned in commit
2adb3832
mentioned in commit 2adb3832a2fe62bc4c77a67e0786e78751c2038d
Toggle commit list
Andrey Vertiprahov
@aversant
mentioned in merge request
!6407 (merged)
·
Jun 25, 2022
mentioned in merge request
!6407 (merged)
mentioned in merge request !6407
Toggle commit list
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment