mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add fips_mode variable to env
Variable fips_mode indicating whether machine is running in FIPS-enabled mode was added to env. https://fedorahosted.org/freeipa/ticket/5695 Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
parent
cc446fb448
commit
3372ad2766
@ -47,6 +47,10 @@ from ipalib.constants import (
|
|||||||
TLS_VERSIONS
|
TLS_VERSIONS
|
||||||
)
|
)
|
||||||
from ipalib import errors
|
from ipalib import errors
|
||||||
|
try:
|
||||||
|
from ipaplatform.tasks import tasks
|
||||||
|
except ImportError:
|
||||||
|
tasks = None
|
||||||
|
|
||||||
if six.PY3:
|
if six.PY3:
|
||||||
unicode = str
|
unicode = str
|
||||||
@ -443,6 +447,10 @@ class Env(object):
|
|||||||
self.bin = path.dirname(self.script)
|
self.bin = path.dirname(self.script)
|
||||||
self.home = os.environ.get('HOME', None)
|
self.home = os.environ.get('HOME', None)
|
||||||
|
|
||||||
|
# Set fips_mode only if ipaplatform module was loaded
|
||||||
|
if tasks is not None:
|
||||||
|
self.fips_mode = tasks.is_fips_enabled()
|
||||||
|
|
||||||
# Merge in overrides:
|
# Merge in overrides:
|
||||||
self._merge(**overrides)
|
self._merge(**overrides)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user