Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inventory-provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
geant-swd
dashboardv3
inventory-provider
Commits
fb62f19a
Commit
fb62f19a
authored
4 years ago
by
Robert Latta
Browse files
Options
Downloads
Patches
Plain Diff
added logging of duplicate email in OTRS customer-user export
parent
52eefd0f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inventory_provider/db/ims_data.py
+17
-0
17 additions, 0 deletions
inventory_provider/db/ims_data.py
with
17 additions
and
0 deletions
inventory_provider/db/ims_data.py
+
17
−
0
View file @
fb62f19a
import
logging
import
re
from
collections
import
OrderedDict
from
inventory_provider
import
environment
from
inventory_provider.db
import
ims
from
inventory_provider.db.ims
import
InventoryStatus
environment
.
setup_logging
()
logger
=
logging
.
getLogger
(
__name__
)
INTERNAL_POP_NAMES
=
{
'
Cambridge OC
'
,
'
DANTE Lab
'
,
...
...
@@ -228,5 +233,17 @@ def otrs_get_customer_users_rows(ds):
yield
c
sorted_cus
=
sorted
(
get_all_cus_user_rows
(),
key
=
lambda
x
:
x
[
'
email
'
])
duplicate_emails
=
set
()
previous_email
=
None
for
cu
in
sorted_cus
:
if
cu
[
'
email
'
]
==
previous_email
:
duplicate_emails
.
add
(
previous_email
)
previous_email
=
cu
[
'
email
'
]
if
duplicate_emails
:
logger
.
error
(
'
Duplicate emails found in OTRS customer-user export:
'
f
'
{
duplicate_emails
}
'
)
# raise KeyError('Duplicate emails found in OTRS customer-user export: ' # noqa
# f'{duplicate_emails}')
for
cu
in
sorted_cus
:
yield
list
(
cu
.
values
())
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