Commit 46754b14 authored by Paul Rich's avatar Paul Rich
Browse files

Fixing typo in function name.

parent 798e4a04
......@@ -22,7 +22,7 @@ import Cobalt.Util
from Cobalt.Components.base import Component, exposed, automatic, locking
from Cobalt.Components.bg_base_system import NodeCard, PartitionDict, BGBaseSystem
from Cobalt.DataTypes.ProcessGroup import ProcessGroup
from Cobalt.Util import sanatize_password, extract_traceback, get_current_thread_identifier
from Cobalt.Util import sanitize_password, extract_traceback, get_current_thread_identifier
get_config_option = Cobalt.Util.get_config_option
__all__ = [
......@@ -121,7 +121,7 @@ class Simulator (BGBaseSystem):
update_func()
except Exception:
te = time.time()
tb_str = sanatize_password('\n'.join(extract_traceback()))
tb_str = sanitize_password('\n'.join(extract_traceback()))
td = te - ts
self.logger.error('_run_and_wrap(%s): td:%s error:%s' % (update_func_name, td, tb_str))
bool_error = True
......
......@@ -22,7 +22,7 @@ from Cobalt.Exceptions import JobValidationError
from Cobalt.DataTypes.ProcessGroup import ProcessGroup
from Cobalt.Util import compact_num_list, expand_num_list
from Cobalt.Util import init_cobalt_config, get_config_option
from Cobalt.Util import extract_traceback, sanatize_password, get_current_thread_identifier
from Cobalt.Util import extract_traceback, sanitize_password, get_current_thread_identifier
from Queue import Queue
_logger = logging.getLogger(__name__)
......@@ -375,7 +375,7 @@ class CraySystem(BaseSystem):
update_func()
except Exception:
te = time.time()
tb_str = sanatize_password('\n'.join(extract_traceback()))
tb_str = sanitize_password('\n'.join(extract_traceback()))
td = te - ts
self.logger.error('_run_and_wrap(%s): td:%s error:%s' % (update_func_name, td, tb_str))
bool_error = True
......
......@@ -59,7 +59,7 @@ def extract_traceback(include_time=True):
return tracebacklst
# FIXME: this cannot be imported from Cobalt.Util because Proxy is imported within Cobalt.Util
def sanatize_password(message):
def sanitize_password(message):
"""strip the password out of a message"""
# this patten will remove from a string formatted from an rpc call
# user:pass@host:port
......@@ -127,45 +127,45 @@ class RetryMethod(_Method):
retval = _Method.__call__(self, *args)
return retval
except xmlrpclib.ProtocolError as err:
tb_str = sanatize_password('\n'.join(extract_traceback()))
tb_str = sanitize_password('\n'.join(extract_traceback()))
log.error("ProtocolError(#%s)[%s]: code:%s msg:%s headers:%s "
"error:%s", retry, get_caller(jump_back_count=2), err.errcode, err.errmsg, err.headers, tb_str)
raise xmlrpclib.Fault(20, "Server Failure")
except xmlrpclib.Fault as fault:
tb_str = sanatize_password('\n'.join(extract_traceback()))
tb_str = sanitize_password('\n'.join(extract_traceback()))
log.error("xmlrpclib.Fault(#%s)[%s]: faultCode:%s faultString:%s "
"error:%s", retry, get_caller(jump_back_count=2), fault.faultCode, fault.faultString, tb_str)
fault.faultString = sanatize_password(fault.faultString)
fault.faultString = sanitize_password(fault.faultString)
# due to clients using the same code, the error was too verbose and had to be reduced but still sanitized.
raise fault
#raise #xmlrpclib.Fault(20, tb_str)
except socket.error as err:
# this is the only path that retries
tb_str = sanatize_password('\n'.join(extract_traceback()))
tb_str = sanitize_password('\n'.join(extract_traceback()))
log.error("socket.error(#%s)[%s]:errno%s error:%s", retry, get_caller(jump_back_count=2), err.errno, tb_str)
if hasattr(err, 'errno') and err.errno == 336265218:
break
if retry >= (self.max_retries - 1):
raise xmlrpclib.Fault(20, tb_str)
except CertificateError as ce:
tb_str = sanatize_password('\n'.join(extract_traceback()))
tb_str = sanitize_password('\n'.join(extract_traceback()))
log.error("CertificateError(#%s)[%s]: invalid commonName %s from server. error:%s",
retry, get_caller(jump_back_count=2), ce.commonName, tb_str)
break
except KeyError:
tb_str = sanatize_password('\n'.join(extract_traceback()))
tb_str = sanitize_password('\n'.join(extract_traceback()))
log.error("KeyError(#%s)[%s]: Server disallowed connection. error:%s",
retry, get_caller(jump_back_count=2), tb_str)
break
except Exception:
tb_str = sanatize_password('\n'.join(extract_traceback()))
tb_str = sanitize_password('\n'.join(extract_traceback()))
log.error("KeyError(#%s)[%s]: error:%s", retry, get_caller(jump_back_count=2), tb_str)
break
try:
time.sleep(0.5)
except IOError:
tb_str = sanatize_password('\n'.join(extract_traceback()))
tb_str = sanitize_password('\n'.join(extract_traceback()))
log.error("time.sleep/IOERROR(#%s)[%s]: error:%s", retry, get_caller(jump_back_count=2), tb_str)
#Yes, you can get an IOError from ppc64 linux kernels
#It has to do with the select that is used to get sub-second
......@@ -419,9 +419,9 @@ def ComponentProxy(component_name, **kwargs):
proxy = _ComponentProxy(component_name, **kwargs)
except:
#some how we need to get the "error" and modify because on retry=False, it will be a ServerProxy, not a Retry...
#tb_str = sanatize_password('\n'.join(extract_traceback()))
#tb_str = sanitize_password('\n'.join(extract_traceback()))
#log.error("%s, ComponentProxy: error:%s", get_caller(1), tb_str)
#print(sanatize_password('\n'.join(extract_traceback())))
#print(sanitize_password('\n'.join(extract_traceback())))
raise
return proxy
......
......@@ -24,7 +24,7 @@ import time
import ssl
import Cobalt
from Cobalt.Util import extract_traceback, sanatize_password
from Cobalt.Util import extract_traceback, sanitize_password
from Cobalt.Proxy import ComponentProxy
class ForkedChild(Exception):
......@@ -185,7 +185,7 @@ class SSLServer (SocketServer.TCPServer, object):
def handle_error(self, request, client_address):
"""used to grab the exception and format the traceback from the error."""
timeout = request.gettimeout()
tb_str = sanatize_password('\n'.join(extract_traceback()))
tb_str = sanitize_password('\n'.join(extract_traceback()))
self.logger.error("Exception: request:%s, addr:%s, timeout:%s "
"error:%s", request, client_address, timeout, tb_str)
......@@ -270,7 +270,7 @@ class XMLRPCRequestHandler (SimpleXMLRPCServer.SimpleXMLRPCRequestHandler):
response = self.server._marshaled_dispatch(data)
except:
tb_str = sanatize_password('\n'.join(extract_traceback()))
tb_str = sanitize_password('\n'.join(extract_traceback()))
self.logger.error("Exception: error:%s", tb_str)
raise
self.send_response(500)
......@@ -366,7 +366,7 @@ class BaseXMLRPCServer (SSLServer, CobaltXMLRPCDispatcher, object):
try:
ComponentProxy("service-location").register(name, self.url)
except Exception:
tb_str = sanatize_password('\n'.join(extract_traceback()))
tb_str = sanitize_password('\n'.join(extract_traceback()))
self.logger.error("register_with_slp() [%s]" % tb_str)
raise
......@@ -378,7 +378,7 @@ class BaseXMLRPCServer (SSLServer, CobaltXMLRPCDispatcher, object):
try:
ComponentProxy("service-location").unregister(name)
except Exception:
tb_str = sanatize_password('\n'.join(extract_traceback()))
tb_str = sanitize_password('\n'.join(extract_traceback()))
self.logger.error("unregister_with_slp() [%s]" % tb_str)
raise
else:
......
......@@ -1268,7 +1268,7 @@ def extract_traceback(include_time=True):
tracebacklst.append(" ".join(("-" * 32, 'END TRACEBACK', "-" * 32)))
return tracebacklst
def sanatize_password(message):
def sanitize_password(message):
"""strip the password out of a message"""
# this patten will remove from a string formatted from an rpc call
# user:pass@host:port
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment