Silence pylint import errors of ipaserver in ipalib and ipaclient

In client-only installations the ipaserver package is not available.
Additional guards prevent pylint to complain about missing ipaserver
package.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Christian Heimes 2017-01-03 15:16:26 +01:00 committed by Martin Basti
parent 25a6ddcce8
commit 987d24f784
2 changed files with 3 additions and 3 deletions

View File

@ -103,7 +103,7 @@ class ServerInfo(collections.MutableMapping):
def get_package(api):
if api.env.in_tree:
from ipaserver import plugins
from ipaserver import plugins # pylint: disable=import-error
else:
try:
plugins = api._remote_plugins

View File

@ -908,7 +908,7 @@ class API(plugable.API):
@property
def packages(self):
if self.env.in_server:
import ipaserver.plugins
import ipaserver.plugins # pylint: disable=import-error
result = (
ipaserver.plugins,
)
@ -921,7 +921,7 @@ class API(plugable.API):
)
if self.env.context in ('installer', 'updates'):
import ipaserver.install.plugins
import ipaserver.install.plugins # pylint: disable=import-error
result += (ipaserver.install.plugins,)
return result