Skip to content

Commit

Permalink
Fix formatting and linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
meaksh committed Jan 30, 2025
1 parent ab593c0 commit efa3ad8
Show file tree
Hide file tree
Showing 4 changed files with 271 additions and 121 deletions.
1 change: 1 addition & 0 deletions python/spacewalk/common/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

logger = logging.getLogger(__name__)


class GeneralRepoException(Exception):
"""
Dpkg repository exception
Expand Down
6 changes: 3 additions & 3 deletions python/spacewalk/common/rhnLog.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ def _exit():

atexit.register(_exit)


def log_level_to_logging_constant(rhnLog_log_level: int):
mapping = {
0: logging.ERROR,
Expand All @@ -318,6 +319,7 @@ def log_level_to_logging_constant(rhnLog_log_level: int):
# 4+: logging.DEBUG
return mapping.get(rhnLog_log_level, logging.DEBUG)


def align_root_logger():
"""Align the root logger with LOG.
Expand All @@ -336,16 +338,14 @@ def align_root_logger():
handler = logging.FileHandler(filename=LOG.file)

formatter = logging.Formatter(
fmt="%(asctime)s - %(name)s - %(message)s",
datefmt="%Y/%m/%d %H:%M:%S"
fmt="%(asctime)s - %(name)s - %(message)s", datefmt="%Y/%m/%d %H:%M:%S"
)
handler.setFormatter(formatter)
root_logger = logging.getLogger(None)
root_logger.handlers = [handler]
root_logger.setLevel(log_level_to_logging_constant(LOG.level))



# ------------------------------------------------------------------------------
if __name__ == "__main__":
print("You can not run this module by itself")
Expand Down
6 changes: 5 additions & 1 deletion python/spacewalk/satellite_tools/repo_plugins/deb_src.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,11 @@ def list_packages(self, filters, latest):
pack.name, pack.version, pack.release, pack.epoch, pack.arch
)
except ValueError as e:
log.error("Skipping package %s. Package contains incorrect metadata.\n%s", new_pack, e)
log.error(
"Skipping package %s. Package contains incorrect metadata.\n%s",
new_pack,
e,
)
continue
new_pack.unique_id = pack
new_pack.checksum_type = pack.checksum_type
Expand Down
Loading

0 comments on commit efa3ad8

Please sign in to comment.