pylint and pep8 fixes

This commit is contained in:
Joshua Harlow 2012-03-12 18:10:29 -07:00
parent 833eed044d
commit 8924904400
4 changed files with 6 additions and 6 deletions

View File

@ -84,7 +84,6 @@ class StackConfigParser(IgnoreMissingConfigParser):
self.db_dsns = dict()
def _resolve_value(self, section, option, value_gotten):
key = make_id(section, option)
if section == 'host' and option == 'ip':
LOG.debug("Host ip from configuration/environment was empty, programatically attempting to determine it.")
value_gotten = utils.get_host_ip()

View File

@ -64,6 +64,7 @@ class AuditAdapter(logging.LoggerAdapter):
warn = logging.LoggerAdapter.warning
def __init__(self, logger):
logging.LoggerAdapter.__init__(self)
self.logger = logger
def audit(self, msg, *args, **kwargs):

View File

@ -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))
def _explode_path(path):
parts = list()
while path != ROOT_PATH:
@ -308,7 +307,8 @@ def mkdirslist(path):
dirs_possible.add(path)
while True:
(base, _) = os.path.split(path)
if not base: break
if not base:
break
dirs_possible.add(base)
path = base
if path == ROOT_PATH:
@ -403,8 +403,8 @@ def rmdir(path, quiet=True, run_as_root=False):
if not isdir(path):
return
try:
with audit(run_as_root):
LOG.debug("Deleting directory \"%s\" with the cavet that we will fail if it's not empty." % (path))
with Rooted(run_as_root):
LOG.audit("Deleting directory \"%s\" with the cavet that we will fail if it's not empty." % (path))
if not DRYRUN_MODE:
os.rmdir(path)
LOG.audit("Deleted directory \"%s\"" % (path))

2
stack
View File

@ -122,7 +122,7 @@ def configure_logging(args):
else:
console_logger.setFormatter(logging.Formatter(console_format))
root_logger.addHandler(console_logger)
# Adjust logging verbose level based on the command line switch.
log_level = logging.INFO
if args['verbosity'] >= 2: