Repository navigation
Transform Map: send rows through the IRE with serial number cleansing - #2675
Open
itam-automation wants to merge 2 commits into
Open
itam-automation wants to merge 2 commits into
itam-automation wants to merge 2 commits into
Conversation
In an onBefore script, error = true halts the transformation of the whole import set, so one row without identifying attributes stopped all rows after it. The script now sets ignore = true first, writes IRE errors to the row comment and the import log, and catches script errors. Column names for the serial number and the source key are constants now. README: result of a transform run with an error row in the middle, the placeholder case narrowed to what was tested, and the fallback of the serial number check.
Author
|
Fixed the error handling in 3389a0e. The script set I tested it again as a real transform run on a PDI, with the bad row in the middle of the import set. With the old version the third row stayed Pending, with the new one it was inserted. The README has the details. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description:
An onBefore transform script that sends each import row through the IRE (
sn_cmdb.IdentificationEngine.createOrUpdateCI) instead of letting the transform map write into the CMDB, plus a small Script Include that drops placeholder serial numbers before identification.The placeholder part is the reason for this snippet: on a PDI with the out-of-box hardware rule, a second computer with a different name, no MAC address and the serial "To be filled by O.E.M." was identified as the existing CI. The cleanser uses the same check as Discovery (
SerialNumberManager.isValid(), rules indscy_invalid_serial), so the list is maintained in one place. The outcome of each row (operation, sys_id, IRE errors) is written to the import row comment. Rows with an IRE error are skipped and logged, so one bad row does not stop the import.Tested on a PDI (Brazil), including a transform run with an error row in the middle of the import set. Results are in the README. Existing IRE snippets in the repo show the
createOrUpdateCIcall on its own. This one covers the transform map use case and the serial number problem.Pull Request Checklist
Overview
Code Quality
Repository Structure Compliance
Documentation
Restrictions