Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lc_ldap
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza Dely
lc_ldap
Commits
e97f8573
Commit
e97f8573
authored
Nov 09, 2014
by
Valentin Samir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ldap_locks] cast all the things ! python-ldap déteste l'unicode
parent
294773ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
ldap_locks.py
ldap_locks.py
+4
-2
No files found.
ldap_locks.py
View file @
e97f8573
...
...
@@ -135,6 +135,7 @@ class LdapLockHolder:
tomber.
"""
try
:
value
=
str
(
value
)
host
,
pid
,
begin
=
self
.
getlock
(
item
,
value
)
time_left
=
self
.
timeout
-
(
time
.
time
()
-
begin
)
if
time_left
<=
0
:
...
...
@@ -183,8 +184,9 @@ class LdapLockHolder:
"""
Libère le lock "$item=$value,$LOCKS_DN".
"""
value
=
str
(
value
)
try
:
if
force
or
str
(
value
)
in
self
.
locks
[
Id
][
item
]:
if
force
or
value
in
self
.
locks
[
Id
][
item
]:
self
.
conn
.
delete_s
(
"%s=%s,%s"
%
(
item
,
value
,
LOCKS_DN
))
except
ldap
.
NO_SUCH_OBJECT
:
pass
...
...
@@ -201,7 +203,7 @@ class LdapLockHolder:
Trouve le lock item=value, et renvoie le contenu de lockinfo
via un triplet host, pid, begin
"""
value
=
str
(
value
)
try
:
result
=
self
.
conn
.
search_s
(
'%s=%s,%s'
%
(
item
,
value
,
LOCKS_DN
),
0
)
host
,
pid
,
begin
=
result
[
0
][
1
][
'lockid'
][
0
].
split
(
'-'
)
...
...
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