-
Notifications
You must be signed in to change notification settings - Fork 3
fix: matching on both dysDescr and sysObjectId #156
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #156 +/- ##
===========================================
- Coverage 47.30% 47.28% -0.03%
===========================================
Files 22 22
Lines 1205 1214 +9
===========================================
+ Hits 570 574 +4
- Misses 635 640 +5
Continue to review full report at Codecov.
|
@@ -251,7 +251,7 @@ def process_unmatched_devices(self, server_config): | |||
if realtime_collection: | |||
descr = extract_desc(realtime_collection) | |||
|
|||
if descr: | |||
if any(descr): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so previously we were checking for if descr is not None, now we are using any that works a little bit differently.
What is the use case for change of logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So previously sysDescr took precedence over sysObjectId and imagine a scenario when someone added pattern on sysObjectId and both sysDescr and sysObjectId were present the match will not occur. I decided to perform matching on both sysDescr and sysObjectId.
def match_profile_with_device(device_desc, profile, profiles, result): | ||
for pattern in profiles[profile]["patterns"]: | ||
for desc in device_desc: | ||
if desc and re.compile(pattern).match(desc): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe compile is same as in java and it is not good to call it each time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Expected release notes (by @weliasz) features: fixes: others (will not be included in Semantic-Release notes):
|
🎉 This PR is included in version 1.5.0-develop.19 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
Matching is now done on both dysDescr and sysObjectId
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Run full matching process and confirmed both properties are used for matching
Checklist