mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-06-26 02:18:21 -04:00
chroots: clean up get_*chroot() function signatures
This commit is contained in:
parent
07a8c3c79a
commit
8a31a98946
4 changed files with 12 additions and 10 deletions
|
@ -395,16 +395,18 @@ chroots: dict[str, Chroot] = {}
|
|||
|
||||
def get_chroot(
|
||||
name: str,
|
||||
chroot_class: type[Chroot],
|
||||
chroot_args: dict,
|
||||
initialize: bool = False,
|
||||
activate: bool = False,
|
||||
fail_if_exists: bool = False,
|
||||
extra_repos: Optional[Mapping[str, RepoInfo]] = None,
|
||||
default: Chroot = None,
|
||||
) -> Chroot:
|
||||
global chroots
|
||||
if default and name not in chroots:
|
||||
logging.debug(f'Adding chroot {name} to chroot map: {default.uuid}')
|
||||
chroots[name] = default
|
||||
if name not in chroots:
|
||||
chroot = chroot_class(name, **chroot_args)
|
||||
logging.debug(f'Adding chroot {name} to chroot map: {chroot.uuid}')
|
||||
chroots[name] = chroot
|
||||
else:
|
||||
existing = chroots[name]
|
||||
if fail_if_exists:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue