diff --git a/lib/charms/operator_libs_linux/v0/apt.py b/lib/charms/operator_libs_linux/v0/apt.py index 70d7e153..11382a63 100644 --- a/lib/charms/operator_libs_linux/v0/apt.py +++ b/lib/charms/operator_libs_linux/v0/apt.py @@ -1340,16 +1340,10 @@ def load_deb822(self, filename: str) -> None: `_parse_deb822_paragraph` assumes that comments have been removed entirely, instead reading the 'Enabled' key to determine if an entry is enabled """ - logger.info(filename) - from pathlib import Path - - logger.info(Path(filename).read_text()) parsed: List[int] = [] skipped: List[InvalidSourceError] = [] with open(filename, "r") as f: - logger.info(filename) for line_number, paragraph in self._iter_paragraphs(f): - logger.info("%s: %s", line_number, paragraph) try: repos = self._parse_deb822_paragraph( paragraph, filename=filename, line_number=line_number @@ -1358,27 +1352,25 @@ def load_deb822(self, filename: str) -> None: skipped.append(e) continue for repo in repos: - logger.info(repo) repo_identifier = "{}-{}-{}".format(repo.repotype, repo.uri, repo.release) self._repository_map[repo_identifier] = repo parsed.append(line_number) - logger.debug("parsed repo: '%s'", repo_identifier) if skipped: - logger.debug("the following errors were raised: %s", skipped) + logger.debug( + "the following errors were encountered when reading deb822 format sources:\n%s", + '\n'.join(str(error) for error in skipped), + ) if parsed: logger.info("parsed %d apt package repositories", len(parsed)) else: - logger.info("here") raise InvalidSourceError("all repository lines in '{}' were invalid!".format(filename)) @staticmethod def _iter_paragraphs(lines: Iterable[str]) -> Iterator[Tuple[int, List[str]]]: - logger.info("_iter_paragraphs") current: Optional[Tuple[int, List[str]]] = None for n, line in enumerate(lines): # 0 indexed line numbers, following `load` - logger.info("%s: %s", n, line) if line.startswith("#"): continue if not line: