URL: https://github.com/freeipa/freeipa/pull/365
Author: tiran
 Title: #365: Silence pylint import errors of ipaserver in ipalib and ipaclient
Action: opened

PR body:
"""
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
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/365/head:pr365
git checkout pr365
From 930a09d460691128083cf3744efef903f9b6ef32 Mon Sep 17 00:00:00 2001
From: Christian Heimes <chei...@redhat.com>
Date: Tue, 3 Jan 2017 15:16:26 +0100
Subject: [PATCH] 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
---
 ipaclient/remote_plugins/__init__.py | 2 +-
 ipalib/__init__.py                   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ipaclient/remote_plugins/__init__.py b/ipaclient/remote_plugins/__init__.py
index 9cf501f..50cfc37 100644
--- a/ipaclient/remote_plugins/__init__.py
+++ b/ipaclient/remote_plugins/__init__.py
@@ -103,7 +103,7 @@ def is_valid(self):
 
 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
diff --git a/ipalib/__init__.py b/ipalib/__init__.py
index 4a61ace..aaca973 100644
--- a/ipalib/__init__.py
+++ b/ipalib/__init__.py
@@ -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 @@ def packages(self):
             )
 
         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
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to