FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Directory Synchronisation Tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Information Services
DevOps
Google WorkSpace (aka G-Suite)
Directory Synchronisation Tool
Commits
777d796e
Commit
777d796e
authored
5 years ago
by
Robin Goodall
Browse files
Options
Downloads
Patches
Plain Diff
missing orgUnitPath sanity check
parent
8a1b02aa
No related branches found
No related tags found
1 merge request
!5
Retry API requests when a HTTP 503 "Service unavaliable" is received
Pipeline
#9189
passed with warnings
5 years ago
Stage: build
Stage: test
Stage: dast
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gsuitesync/sync.py
+11
-0
11 additions, 0 deletions
gsuitesync/sync.py
with
11 additions
and
0 deletions
gsuitesync/sync.py
+
11
−
0
View file @
777d796e
...
...
@@ -124,6 +124,17 @@ def sync(configuration, *, read_only=True):
LOG
.
info
(
'
Ignoring users whose organization unit path matches %r
'
,
sync_config
.
ignore_google_org_unit_path_regex
)
# Check that all users have an orgUnitPath
missing_org
=
[
u
for
u
in
all_google_users
if
'
orgUnitPath
'
not
in
u
]
if
len
(
missing_org
)
!=
0
:
LOG
.
error
(
'
User entries missing orgUnitPath: %s (starting with %s)
'
,
len
(
missing_org
),
missing_org
[
0
][
'
primaryEmail
'
]
if
'
primaryEmail
'
in
missing_org
[
0
]
else
'
user with blank email
'
)
raise
RuntimeError
(
'
Sanity check failed: at least one user is missing orgUnitPath
'
)
# Remove users matching regex
regex
=
re
.
compile
(
sync_config
.
ignore_google_org_unit_path_regex
)
all_google_users
=
[
u
for
u
in
all_google_users
if
not
regex
.
match
(
u
[
'
orgUnitPath
'
])
...
...
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