Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
2fc808b8
Commit
2fc808b8
authored
Jun 27, 2017
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix PAS: do not return None when person is found
parent
11dab143
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
master/product/SlapOS/SlapOSMachineAuthenticationPlugin.py
master/product/SlapOS/SlapOSMachineAuthenticationPlugin.py
+5
-3
No files found.
master/product/SlapOS/SlapOSMachineAuthenticationPlugin.py
View file @
2fc808b8
...
...
@@ -132,14 +132,16 @@ class SlapOSMachineAuthenticationPlugin(BasePlugin):
# search for user linked to this serial
certificate_login_list
=
self
.
portal_catalog
.
unrestrictedSearchResults
(
portal_type
=
self
.
certificate_portal_type
,
reference
=
serial
)
# XXX - reference should not contain '.crt.pem' here
reference
=
serial
.
lower
()
+
'.crt.pem'
,
validation_state
=
'validated'
)
creds
[
'machine_login'
]
=
None
if
len
(
certificate_login_list
)
!=
0
:
if
len
(
certificate_login_list
)
>
1
:
raise
ConsistencyError
(
'There is more than one of %s whose
\
serial is %s'
%
(
self
.
certificate_portal_type
,
serial
))
creds
[
'machine_login'
]
=
certificate_login_list
[
0
]
\
.
getParent
().
getReference
()
creds
[
'machine_login'
]
=
certificate_login_list
[
0
]
\
.
getParentValue
().
getReference
()
elif
user_id
is
not
None
:
creds
[
'machine_login'
]
=
user_id
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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