mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Remove unused locking "context manager"
Class ods_db_lock is unused since August 2015. Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
committed by
Martin Basti
parent
8253727de1
commit
45bb2ad045
@@ -20,7 +20,6 @@ from binascii import hexlify
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import dateutil.tz
|
import dateutil.tz
|
||||||
import dns.dnssec
|
import dns.dnssec
|
||||||
import fcntl
|
|
||||||
from gssapi.exceptions import GSSError
|
from gssapi.exceptions import GSSError
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
@@ -197,18 +196,6 @@ def ods2bind_timestamps(key_state, key_type, ods_times):
|
|||||||
|
|
||||||
return bind_times
|
return bind_times
|
||||||
|
|
||||||
class ods_db_lock(object):
|
|
||||||
def __enter__(self):
|
|
||||||
self.f = open(ODS_DB_LOCK_PATH, 'w')
|
|
||||||
log.debug('waiting for lock %r', self.f)
|
|
||||||
fcntl.lockf(self.f, fcntl.LOCK_EX)
|
|
||||||
log.debug('acquired lock %r', self.f)
|
|
||||||
|
|
||||||
def __exit__(self, *args):
|
|
||||||
fcntl.lockf(self.f, fcntl.LOCK_UN)
|
|
||||||
log.debug('released lock %r', self.f)
|
|
||||||
self.f.close()
|
|
||||||
|
|
||||||
def get_ldap_zone(ldap, dns_base, name):
|
def get_ldap_zone(ldap, dns_base, name):
|
||||||
zone_names = ["%s." % name, name]
|
zone_names = ["%s." % name, name]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user