Skip to content

Commit

Permalink
make tox -e check_format happy
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealFalcon committed Sep 21, 2023
1 parent feaa88a commit 4b245c0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cloudinit/distros/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ def _unpickle(self, ci_pkl_version: int) -> None:

def _extract_package_by_manager(
self, pkglist: Iterable
) -> Tuple[Dict[Type[PackageManager], Set[str]], Set[str]]:
) -> Tuple[Dict[Type[PackageManager], Set], Set]:
"""Transform the generic package list to package by package manager.
Additionally, include list of generic packages
"""
packages_by_manager = defaultdict(set)
generic_packages: Set[str] = set()
generic_packages: Set = set()
for entry in pkglist:
if isinstance(entry, dict):
for package_manager, package_list in entry.items():
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/distros/package_management/apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def get_all_packages(self):
def get_unavailable_packages(self, pkglist: Iterable[str]):
return [pkg for pkg in pkglist if pkg not in self.get_all_packages()]

def install_packages(self, pkglist: Iterable[str]) -> UninstalledPackages:
def install_packages(self, pkglist: Iterable) -> UninstalledPackages:
self.update_package_sources()
pkglist = util.expand_package_list("%s=%s", list(pkglist))
unavailable = self.get_unavailable_packages(
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/distros/package_management/package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def update_package_sources(self):
...

@abstractmethod
def install_packages(self, pkglist: Iterable[str]) -> UninstalledPackages:
def install_packages(self, pkglist: Iterable) -> UninstalledPackages:
"""Install the given packages.
Return a list of packages that failed to install.
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/distros/package_management/snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Snap(PackageManager):
def update_package_sources(self):
pass

def install_packages(self, pkglist: Iterable[str]) -> UninstalledPackages:
def install_packages(self, pkglist: Iterable) -> UninstalledPackages:
# Snap doesn't provide us with a mechanism to know which packages
# are available or have failed, so install one at a time
pkglist = util.expand_package_list("%s=%s", list(pkglist))
Expand Down
6 changes: 4 additions & 2 deletions cloudinit/distros/package_management/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from typing import Dict, Type

from cloudinit.distros.package_management.apt import Apt
from cloudinit.distros.package_management.package_manager import PackageManager
from cloudinit.distros.package_management.snap import Snap


known_package_managers = {
known_package_managers: Dict[str, Type[PackageManager]] = {
"apt": Apt,
"snap": Snap,
}

0 comments on commit 4b245c0

Please sign in to comment.