mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
support using trust-related operations in the server console
When using `ipa -e in_server=True console` on IPA master, the whole IPA
framework is loaded in the same process ('ipa console'). The context
defined for this configuration is 'cli'. Some trust-related operations
need to load Samba bindings and guard itself to 'lite' and 'server'
contexts.
Upon reviewing these cases I came to conclusion that these guards are
unnecessary. It is enough to require that the context is in the server
code.
Allow these operations if we are operating in server mode. This allows
to debug trust-related issued directly in the IPA console on IPA trust
controllers.
Signed-of-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
committed by
Rob Crittenden
parent
28389fe8af
commit
ecc0a96d16
@@ -52,7 +52,7 @@ if six.PY3:
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
if api.env.in_server and api.env.context in ['lite', 'server']:
|
||||
if api.env.in_server:
|
||||
try:
|
||||
import ipaserver.dcerpc
|
||||
_dcerpc_bindings_installed = True
|
||||
|
||||
@@ -24,7 +24,7 @@ from ipalib import Command, Str, Flag, Int
|
||||
from ipalib import _
|
||||
from ipapython.dn import DN
|
||||
from ipalib.plugable import Registry
|
||||
if api.env.in_server and api.env.context in ['lite', 'server']:
|
||||
if api.env.in_server:
|
||||
try:
|
||||
import ipaserver.dcerpc
|
||||
_dcerpc_bindings_installed = True
|
||||
|
||||
@@ -30,7 +30,7 @@ from ipapython.dn import DN
|
||||
if six.PY3:
|
||||
unicode = str
|
||||
|
||||
if api.env.in_server and api.env.context in ['lite', 'server']:
|
||||
if api.env.in_server:
|
||||
try:
|
||||
import ipaserver.dcerpc
|
||||
_dcerpc_bindings_installed = True
|
||||
|
||||
@@ -49,7 +49,7 @@ if six.PY3:
|
||||
|
||||
_dcerpc_bindings_installed = False
|
||||
|
||||
if api.env.in_server and api.env.context in ['lite', 'server']:
|
||||
if api.env.in_server:
|
||||
try:
|
||||
import ipaserver.dcerpc
|
||||
_dcerpc_bindings_installed = True
|
||||
|
||||
@@ -73,7 +73,7 @@ try:
|
||||
except Exception as e:
|
||||
_nss_idmap_installed = False
|
||||
|
||||
if api.env.in_server and api.env.context in ['lite', 'server']:
|
||||
if api.env.in_server:
|
||||
try:
|
||||
import ipaserver.dcerpc
|
||||
_bindings_installed = True
|
||||
|
||||
Reference in New Issue
Block a user