Autotest uses a site extension mechanism that allows for extending the functions/API of the framework. But in upstream code, such extensions won't be there, reason why it is OK to ignore if they are missing.
Signed-off-by: Lucas Meneghel Rodrigues <[email protected]> --- client/net/net_utils.py | 8 ++++++++ client/partition.py | 2 ++ client/shared/mail_unittest.py | 2 ++ client/shared/utils.py | 2 ++ client/utils.py | 2 ++ server/frontend.py | 2 ++ server/utils.py | 2 ++ 7 files changed, 20 insertions(+) diff --git a/client/net/net_utils.py b/client/net/net_utils.py index b267794..277692b 100644 --- a/client/net/net_utils.py +++ b/client/net/net_utils.py @@ -101,6 +101,8 @@ class network_utils(object): def network(): try: + # Here we are importing site net utils only if it exists + # pylint: disable=E0611 from autotest.client.net import site_net_utils return site_net_utils.network_utils() except ImportError: @@ -383,6 +385,8 @@ class network_interface(object): def netif(name): try: + # Here we are importing site net utils only if it exists + # pylint: disable=E0611 from autotest.client.net import site_net_utils return site_net_utils.network_interface(name) except ImportError: @@ -448,6 +452,8 @@ class bonding(object): def bond(): try: + # Here we are importing site net utils only if it exists + # pylint: disable=E0611 from autotest.client.net import site_net_utils return site_net_utils.bonding() except ImportError: @@ -742,6 +748,8 @@ class ethernet(object): def ethernet_packet(): try: + # Here we are importing site net utils only if it exists + # pylint: disable=E0611 from autotest.client.net import site_net_utils return site_net_utils.ethernet() except ImportError: diff --git a/client/partition.py b/client/partition.py index 4939fe7..7bc8f28 100644 --- a/client/partition.py +++ b/client/partition.py @@ -1001,6 +1001,8 @@ class virtual_partition: # import a site partition module to allow it to override functions try: + # Here we are importing site_partition only if it exists + # pylint: disable=E0611 from autotest.client.site_partition import * except ImportError: pass diff --git a/client/shared/mail_unittest.py b/client/shared/mail_unittest.py index 68bfce1..385fcf5 100755 --- a/client/shared/mail_unittest.py +++ b/client/shared/mail_unittest.py @@ -2,6 +2,8 @@ import unittest import mail +# the email module has some weird behavior change among py 2.4/2.6 +# pylint: disable=E0611 from email import Message class test_data: diff --git a/client/shared/utils.py b/client/shared/utils.py index 2208f3f..709d0cb 100644 --- a/client/shared/utils.py +++ b/client/shared/utils.py @@ -10,4 +10,6 @@ inheritance with, just a collection of static methods. from autotest.client.shared.base_utils import * if os.path.exists(os.path.join(os.path.dirname(__file__), 'site_utils.py')): + # Here we are importing site utils only if it exists + # pylint: disable=E0611 from autotest.client.shared.site_utils import * diff --git a/client/utils.py b/client/utils.py index a88b9cb..ce3a1d3 100644 --- a/client/utils.py +++ b/client/utils.py @@ -12,4 +12,6 @@ import os from autotest.client.shared.utils import * from autotest.client.base_utils import * if os.path.exists(os.path.join(os.path.dirname(__file__), 'site_utils.py')): + # Here we are importing site utils only if it exists + # pylint: disable=E0611 from autotest.client.site_utils import * diff --git a/server/frontend.py b/server/frontend.py index fbef6ed..9f13f46 100644 --- a/server/frontend.py +++ b/server/frontend.py @@ -23,6 +23,8 @@ from autotest.frontend.afe import rpc_client_lib from autotest.client.shared.settings import settings from autotest.client.shared import utils try: + # Here we are importing site utils only if it exists + # pylint: disable=E0611 from autotest.server.site_common import site_utils as server_utils except ImportError: from autotest.server import utils as server_utils diff --git a/server/utils.py b/server/utils.py index 94d06dc..bc97d86 100644 --- a/server/utils.py +++ b/server/utils.py @@ -11,4 +11,6 @@ inheritance with, just a collection of static methods. from autotest.client.shared.utils import * from autotest.server.base_utils import * if os.path.exists(os.path.join(os.path.dirname(__file__), 'site_utils.py')): + # Here we are importing site utils only if it exists + # pylint: disable=E0611 from autotest.server.site_utils import * -- 1.8.1.4 _______________________________________________ Autotest-kernel mailing list [email protected] https://www.redhat.com/mailman/listinfo/autotest-kernel
