scripts, tests: explicitly set confdir in the rest of server code

Commit 1e6a204b43 added explicit confdir
setting to api.bootstrap() calls of a randomly selected portion of
server-side scripts and tests. This commit adds it to the rest of
server-side code for consistency.

https://fedorahosted.org/freeipa/ticket/6389

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
Jan Cholasta
2016-12-02 09:10:41 +01:00
parent cf25ea7e30
commit fe6f2b6f6e
13 changed files with 37 additions and 15 deletions

View File

@@ -34,6 +34,7 @@ from nose.tools import assert_raises # pylint: disable=E0611
import nss.nss as nss
import six
from ipaplatform.paths import paths
from ipaserver.plugins.ldap2 import ldap2
from ipalib import api, x509, create_api, errors
from ipapython import ipautil
@@ -111,7 +112,7 @@ class test_ldap(object):
# a client-only api. Then we register in the commands and objects
# we need for the test.
myapi = create_api(mode=None)
myapi.bootstrap(context='cli', in_server=True)
myapi.bootstrap(context='cli', in_server=True, confdir=paths.ETC_IPA)
myapi.finalize()
pwfile = api.env.dot_ipa + os.sep + ".dmpw"

View File

@@ -11,6 +11,7 @@ from collections import namedtuple
import ldap
import pytest
from ipaplatform.paths import paths
from ipalib import api, create_api, errors
from ipapython.dn import DN
from ipatests.util import MockLDAP
@@ -469,7 +470,9 @@ class MockMasterTopology(object):
@pytest.fixture(scope='module')
def mock_api(request):
test_api = create_api(mode=None)
test_api.bootstrap(in_server=True, ldap_uri=api.env.ldap_uri)
test_api.bootstrap(in_server=True,
ldap_uri=api.env.ldap_uri,
confdir=paths.ETC_IPA)
test_api.finalize()
if not test_api.Backend.ldap2.isconnected():