On commit c7af4524, the idea was to log to the rpc server logger when a given hostname was not registered on the available install server, but referred to the wrong object (it was getting the rpc server logger object defined on rpcserver_logging, which is in fact None). Fix this by retrieving the actual rpc_logger singleton using a standard logging API.
Signed-off-by: Lucas Meneghel Rodrigues <[email protected]> --- frontend/afe/rpc_interface.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/afe/rpc_interface.py b/frontend/afe/rpc_interface.py index 37f9263..f24be40 100644 --- a/frontend/afe/rpc_interface.py +++ b/frontend/afe/rpc_interface.py @@ -29,7 +29,7 @@ See doctests/001_rpc_test.txt for (lots) more examples. __author__ = '[email protected] (Steve Howard)' -import datetime, xmlrpclib +import datetime, xmlrpclib, logging try: import autotest.common as common except ImportError: @@ -219,14 +219,16 @@ def get_hosts(multiple_labels=(), exclude_only_if_needed_labels=False, if len(system_list) < 1: msg = 'System "%s" not found on install server' - rpcserver_logging.rpc_logger.info(msg, host_dict['hostname']) + rpc_logger = logging.getLogger('rpc_logger') + rpc_logger.info(msg, host_dict['hostname']) elif len(system_list) > 1: msg = 'Found multiple systems on install server named %s' if install_server_type == 'cobbler': msg = '%s. This should never happen on cobbler' % msg - rpcserver_logging.rpc_logger.error(msg, host_dict['hostname']) + rpc_logger = logging.getLogger('rpc_logger') + rpc_logger.error(msg, host_dict['hostname']) else: system = system_list[0] -- 1.7.11.2 _______________________________________________ Autotest-kernel mailing list [email protected] https://www.redhat.com/mailman/listinfo/autotest-kernel
