mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-30 10:47:08 -06:00
a1f260d021
The dnssec and secrets subpackages and the p11helper module depend on ipaplatform. Move them to ipaserver as they are used only on the server. https://fedorahosted.org/freeipa/ticket/6474 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
23 lines
506 B
Python
23 lines
506 B
Python
#
|
|
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
|
|
#
|
|
|
|
import errno
|
|
import shutil
|
|
import tempfile
|
|
|
|
class TemporaryDirectory(object):
|
|
def __init__(self, root):
|
|
self.root = root
|
|
|
|
def __enter__(self):
|
|
self.name = tempfile.mkdtemp(dir=self.root)
|
|
return self.name
|
|
|
|
def __exit__(self, exc_type, exc_value, traceback):
|
|
try:
|
|
shutil.rmtree(self.name)
|
|
except OSError as e:
|
|
if e.errno != errno.ENOENT:
|
|
raise
|