mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Changing how commands handles error when it can't connect to IPA server
Creating a method to check if ipa client is configured. Also, changing scripts to use it instead of duplicating the check. https://pagure.io/freeipa/issue/6261 Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
committed by
Tomas Krizek
parent
a3c99367bf
commit
cac3475a04
@@ -34,6 +34,7 @@ from ipaplatform.paths import paths
|
||||
from ipaplatform.tasks import tasks
|
||||
from ipalib import api, errors, x509
|
||||
from ipalib.constants import IPA_CA_NICKNAME, RENEWAL_CA_NAME
|
||||
from ipalib.util import check_client_configuration
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -50,11 +51,7 @@ class CertUpdate(admintool.AdminTool):
|
||||
super(CertUpdate, self).validate_options(needs_root=True)
|
||||
|
||||
def run(self):
|
||||
fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE)
|
||||
if (not fstore.has_files() and
|
||||
not os.path.exists(paths.IPA_DEFAULT_CONF)):
|
||||
raise admintool.ScriptError(
|
||||
"IPA client is not configured on this system.")
|
||||
check_client_configuration()
|
||||
|
||||
api.bootstrap(context='cli_installer', confdir=paths.ETC_IPA)
|
||||
api.finalize()
|
||||
|
||||
Reference in New Issue
Block a user