mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Remove unused modutils wrappers from NSS/CertDB
The disable system trust feature is no longer used. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
@@ -308,15 +308,6 @@ class NSSDatabase(object):
|
|||||||
new_args.extend(args)
|
new_args.extend(args)
|
||||||
return ipautil.run(new_args, stdin, **kwargs)
|
return ipautil.run(new_args, stdin, **kwargs)
|
||||||
|
|
||||||
def run_modutil(self, args, stdin=None, **kwargs):
|
|
||||||
self._check_db()
|
|
||||||
new_args = [
|
|
||||||
paths.MODUTIL,
|
|
||||||
'-dbdir', '{}:{}'.format(self.dbtype, self.secdir)
|
|
||||||
]
|
|
||||||
new_args.extend(args)
|
|
||||||
return ipautil.run(new_args, stdin, **kwargs)
|
|
||||||
|
|
||||||
def exists(self):
|
def exists(self):
|
||||||
"""Check DB exists (all files are present)
|
"""Check DB exists (all files are present)
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -276,9 +276,6 @@ class CertDB(object):
|
|||||||
def run_certutil(self, args, stdin=None, **kwargs):
|
def run_certutil(self, args, stdin=None, **kwargs):
|
||||||
return self.nssdb.run_certutil(args, stdin, **kwargs)
|
return self.nssdb.run_certutil(args, stdin, **kwargs)
|
||||||
|
|
||||||
def run_modutil(self, args, stdin=None, **kwargs):
|
|
||||||
return self.nssdb.run_modutil(args, stdin, **kwargs)
|
|
||||||
|
|
||||||
def create_noise_file(self):
|
def create_noise_file(self):
|
||||||
if os.path.isfile(self.noise_fname):
|
if os.path.isfile(self.noise_fname):
|
||||||
os.remove(self.noise_fname)
|
os.remove(self.noise_fname)
|
||||||
@@ -690,32 +687,6 @@ class CertDB(object):
|
|||||||
|
|
||||||
return is_ipa_issued_cert(api, cert)
|
return is_ipa_issued_cert(api, cert)
|
||||||
|
|
||||||
def disable_system_trust(self):
|
|
||||||
"""Disable system trust module of NSSDB
|
|
||||||
"""
|
|
||||||
name = 'Root Certs'
|
|
||||||
try:
|
|
||||||
result = self.run_modutil(
|
|
||||||
['-force', '-list', name],
|
|
||||||
env={},
|
|
||||||
capture_output=True
|
|
||||||
)
|
|
||||||
except ipautil.CalledProcessError as e:
|
|
||||||
if e.returncode == 29: # ERROR: Module not found in database.
|
|
||||||
logger.debug(
|
|
||||||
'Module %s not available, treating as disabled', name)
|
|
||||||
return False
|
|
||||||
raise
|
|
||||||
|
|
||||||
if 'Status: Enabled' in result.output:
|
|
||||||
self.run_modutil(
|
|
||||||
['-force', '-disable', name],
|
|
||||||
env={}
|
|
||||||
)
|
|
||||||
return True
|
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
def needs_upgrade_format(self):
|
def needs_upgrade_format(self):
|
||||||
"""Check if NSSDB file format needs upgrade
|
"""Check if NSSDB file format needs upgrade
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user