trivial: Remove dead code
The following functions are unused by anything but tests, or are only used in one place and don't merit being in a utils module: - xhtml_escape - check_isinstance Remove or replace them. Change-Id: I5a57a416cb0912ad42fe8cdd6cf264020bdf2652
This commit is contained in:
parent
5b507b73ce
commit
5ddf400d93
@ -35,7 +35,6 @@ import sys
|
||||
import tempfile
|
||||
import textwrap
|
||||
import time
|
||||
from xml.sax import saxutils
|
||||
|
||||
import eventlet
|
||||
import netaddr
|
||||
@ -163,13 +162,6 @@ def get_root_helper():
|
||||
return cmd
|
||||
|
||||
|
||||
def _get_rootwrap_helper():
|
||||
if CONF.use_rootwrap_daemon:
|
||||
return RootwrapDaemonHelper(CONF.rootwrap_config)
|
||||
else:
|
||||
return RootwrapProcessHelper()
|
||||
|
||||
|
||||
class RootwrapProcessHelper(object):
|
||||
def trycmd(self, *cmd, **kwargs):
|
||||
kwargs['root_helper'] = get_root_helper()
|
||||
@ -330,11 +322,6 @@ DEFAULT_PASSWORD_SYMBOLS = ('23456789', # Removed: 0,1
|
||||
'abcdefghijkmnopqrstuvwxyz') # Removed: l
|
||||
|
||||
|
||||
# ~5 bits per symbol
|
||||
EASIER_PASSWORD_SYMBOLS = ('23456789', # Removed: 0, 1
|
||||
'ABCDEFGHJKLMNPQRSTUVWXYZ') # Removed: I, O
|
||||
|
||||
|
||||
def last_completed_audit_period(unit=None, before=None):
|
||||
"""This method gives you the most recently *completed* audit period.
|
||||
|
||||
@ -480,13 +467,7 @@ def get_my_linklocal(interface):
|
||||
raise exception.NovaException(msg)
|
||||
|
||||
|
||||
def xhtml_escape(value):
|
||||
"""Escapes a string so it is valid within XML or XHTML.
|
||||
|
||||
"""
|
||||
return saxutils.escape(value, {'"': '"', "'": '''})
|
||||
|
||||
|
||||
# TODO(sfinucan): Replace this with the equivalent from oslo.utils
|
||||
def utf8(value):
|
||||
"""Try to turn a string into utf-8 if possible.
|
||||
|
||||
@ -503,13 +484,6 @@ def utf8(value):
|
||||
return value.encode('utf-8')
|
||||
|
||||
|
||||
def check_isinstance(obj, cls):
|
||||
"""Checks that obj is of type cls, and lets PyLint infer types."""
|
||||
if isinstance(obj, cls):
|
||||
return obj
|
||||
raise Exception(_('Expected object of type: %s') % (str(cls)))
|
||||
|
||||
|
||||
def parse_server_string(server_str):
|
||||
"""Parses the given server_string and returns a tuple of host and port.
|
||||
If it's not a combination of host part and port, the port element
|
||||
|
Loading…
x
Reference in New Issue
Block a user