pylint and pep8 fixes
This commit is contained in:
parent
833eed044d
commit
8924904400
@ -84,7 +84,6 @@ class StackConfigParser(IgnoreMissingConfigParser):
|
|||||||
self.db_dsns = dict()
|
self.db_dsns = dict()
|
||||||
|
|
||||||
def _resolve_value(self, section, option, value_gotten):
|
def _resolve_value(self, section, option, value_gotten):
|
||||||
key = make_id(section, option)
|
|
||||||
if section == 'host' and option == 'ip':
|
if section == 'host' and option == 'ip':
|
||||||
LOG.debug("Host ip from configuration/environment was empty, programatically attempting to determine it.")
|
LOG.debug("Host ip from configuration/environment was empty, programatically attempting to determine it.")
|
||||||
value_gotten = utils.get_host_ip()
|
value_gotten = utils.get_host_ip()
|
||||||
|
@ -64,6 +64,7 @@ class AuditAdapter(logging.LoggerAdapter):
|
|||||||
warn = logging.LoggerAdapter.warning
|
warn = logging.LoggerAdapter.warning
|
||||||
|
|
||||||
def __init__(self, logger):
|
def __init__(self, logger):
|
||||||
|
logging.LoggerAdapter.__init__(self)
|
||||||
self.logger = logger
|
self.logger = logger
|
||||||
|
|
||||||
def audit(self, msg, *args, **kwargs):
|
def audit(self, msg, *args, **kwargs):
|
||||||
|
@ -255,7 +255,6 @@ def chown_r(path, uid, gid, run_as_root=True):
|
|||||||
LOG.audit("Changing ownership of %s to %s:%s" % (joinpths(root, f), uid, gid))
|
LOG.audit("Changing ownership of %s to %s:%s" % (joinpths(root, f), uid, gid))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _explode_path(path):
|
def _explode_path(path):
|
||||||
parts = list()
|
parts = list()
|
||||||
while path != ROOT_PATH:
|
while path != ROOT_PATH:
|
||||||
@ -308,7 +307,8 @@ def mkdirslist(path):
|
|||||||
dirs_possible.add(path)
|
dirs_possible.add(path)
|
||||||
while True:
|
while True:
|
||||||
(base, _) = os.path.split(path)
|
(base, _) = os.path.split(path)
|
||||||
if not base: break
|
if not base:
|
||||||
|
break
|
||||||
dirs_possible.add(base)
|
dirs_possible.add(base)
|
||||||
path = base
|
path = base
|
||||||
if path == ROOT_PATH:
|
if path == ROOT_PATH:
|
||||||
@ -403,8 +403,8 @@ def rmdir(path, quiet=True, run_as_root=False):
|
|||||||
if not isdir(path):
|
if not isdir(path):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
with audit(run_as_root):
|
with Rooted(run_as_root):
|
||||||
LOG.debug("Deleting directory \"%s\" with the cavet that we will fail if it's not empty." % (path))
|
LOG.audit("Deleting directory \"%s\" with the cavet that we will fail if it's not empty." % (path))
|
||||||
if not DRYRUN_MODE:
|
if not DRYRUN_MODE:
|
||||||
os.rmdir(path)
|
os.rmdir(path)
|
||||||
LOG.audit("Deleted directory \"%s\"" % (path))
|
LOG.audit("Deleted directory \"%s\"" % (path))
|
||||||
|
2
stack
2
stack
@ -122,7 +122,7 @@ def configure_logging(args):
|
|||||||
else:
|
else:
|
||||||
console_logger.setFormatter(logging.Formatter(console_format))
|
console_logger.setFormatter(logging.Formatter(console_format))
|
||||||
root_logger.addHandler(console_logger)
|
root_logger.addHandler(console_logger)
|
||||||
|
|
||||||
# Adjust logging verbose level based on the command line switch.
|
# Adjust logging verbose level based on the command line switch.
|
||||||
log_level = logging.INFO
|
log_level = logging.INFO
|
||||||
if args['verbosity'] >= 2:
|
if args['verbosity'] >= 2:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user