Fixing tox and pylint errors

Fixing import errors introduced by commits
icac3475a0454b730d6e5b2093c2e63d395acd387 and
0b7d9c5.

https://pagure.io/freeipa/issue/7132

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
This commit is contained in:
Felipe Barreto
2017-10-23 18:11:30 +02:00
committed by Tomas Krizek
parent b29db07c3b
commit be66eadb62
3 changed files with 31 additions and 6 deletions
+6 -6
View File
@@ -55,10 +55,6 @@ from ipalib.constants import (
TLS_VERSIONS, TLS_VERSION_MINIMAL, TLS_HIGH_CIPHERS
)
from ipalib.text import _
# pylint: disable=ipa-forbidden-import
from ipalib.install import sysrestore
from ipaplatform.paths import paths
# pylint: enable=ipa-forbidden-import
from ipapython.ssh import SSHPublicKey
from ipapython.dn import DN, RDN
from ipapython.dnsutil import DNSName
@@ -68,6 +64,9 @@ from ipapython.admintool import ScriptError
if six.PY3:
unicode = str
_IPA_CLIENT_SYSRESTORE = "/var/lib/ipa-client/sysrestore"
_IPA_DEFAULT_CONF = "/etc/ipa/default.conf"
logger = logging.getLogger(__name__)
@@ -1078,8 +1077,9 @@ def check_client_configuration():
"""
Check if IPA client is configured on the system.
"""
fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE)
if not fstore.has_files() and not os.path.exists(paths.IPA_DEFAULT_CONF):
if (not os.path.isfile(_IPA_DEFAULT_CONF) or
not os.path.isdir(_IPA_CLIENT_SYSRESTORE) or
not os.listdir(_IPA_CLIENT_SYSRESTORE)):
raise ScriptError('IPA client is not configured on this system')